a. jwtToken
API retrieve JWT token that is used for authorization in BaaS project APIs
/oauth2/token
Примеры использования и SDK
curl -X POST \
-H "Authorization: Basic [[basicHash]]" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
"http://http:/oauth2/token" \
-d '{
"password" : "password",
"grant_type" : "password",
"username" : "username"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AuthorizationApi;
import java.io.File;
import java.util.*;
public class AuthorizationApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: BasicAuth
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
BasicAuth.setUsername("YOUR USERNAME");
BasicAuth.setPassword("YOUR PASSWORD");
// Create an instance of the API class
AuthorizationApi apiInstance = new AuthorizationApi();
ApiRequestJwtTokenRequest apiRequestJwtTokenRequest = ; // ApiRequestJwtTokenRequest |
try {
ApiResponseJwtTokenResponse result = apiInstance.a. jwtToken(apiRequestJwtTokenRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AuthorizationApi#a. jwtToken");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final ApiRequestJwtTokenRequest apiRequestJwtTokenRequest = new ApiRequestJwtTokenRequest(); // ApiRequestJwtTokenRequest |
try {
final result = await api_instance.a. jwtToken(apiRequestJwtTokenRequest);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->a. jwtToken: $e\n');
}
import org.openapitools.client.api.AuthorizationApi;
public class AuthorizationApiExample {
public static void main(String[] args) {
AuthorizationApi apiInstance = new AuthorizationApi();
ApiRequestJwtTokenRequest apiRequestJwtTokenRequest = ; // ApiRequestJwtTokenRequest |
try {
ApiResponseJwtTokenResponse result = apiInstance.a. jwtToken(apiRequestJwtTokenRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AuthorizationApi#a. jwtToken");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
// Create an instance of the API class
AuthorizationApi *apiInstance = [[AuthorizationApi alloc] init];
ApiRequestJwtTokenRequest *apiRequestJwtTokenRequest = ; //
[apiInstance a. jwtTokenWith:apiRequestJwtTokenRequest
completionHandler: ^(ApiResponseJwtTokenResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var BaaSProjectApis = require('baa_s_project_apis');
var defaultClient = BaaSProjectApis.ApiClient.instance;
// Configure HTTP basic authorization: BasicAuth
var BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
// Create an instance of the API class
var api = new BaaSProjectApis.AuthorizationApi()
var apiRequestJwtTokenRequest = ; // {ApiRequestJwtTokenRequest}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.a. jwtToken(apiRequestJwtTokenRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class a. jwtTokenExample
{
public void main()
{
// Configure HTTP basic authorization: BasicAuth
Configuration.Default.Username = "YOUR_USERNAME";
Configuration.Default.Password = "YOUR_PASSWORD";
// Create an instance of the API class
var apiInstance = new AuthorizationApi();
var apiRequestJwtTokenRequest = new ApiRequestJwtTokenRequest(); // ApiRequestJwtTokenRequest |
try {
ApiResponseJwtTokenResponse result = apiInstance.a. jwtToken(apiRequestJwtTokenRequest);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling AuthorizationApi.a. jwtToken: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: BasicAuth
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AuthorizationApi();
$apiRequestJwtTokenRequest = ; // ApiRequestJwtTokenRequest |
try {
$result = $api_instance->a. jwtToken($apiRequestJwtTokenRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AuthorizationApi->a. jwtToken: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AuthorizationApi;
# Configure HTTP basic authorization: BasicAuth
$WWW::OPenAPIClient::Configuration::username = 'YOUR_USERNAME';
$WWW::OPenAPIClient::Configuration::password = 'YOUR_PASSWORD';
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AuthorizationApi->new();
my $apiRequestJwtTokenRequest = WWW::OPenAPIClient::Object::ApiRequestJwtTokenRequest->new(); # ApiRequestJwtTokenRequest |
eval {
my $result = $api_instance->a. jwtToken(apiRequestJwtTokenRequest => $apiRequestJwtTokenRequest);
print Dumper($result);
};
if ($@) {
warn "Exception when calling AuthorizationApi->a. jwtToken: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: BasicAuth
openapi_client.configuration.username = 'YOUR_USERNAME'
openapi_client.configuration.password = 'YOUR_PASSWORD'
# Create an instance of the API class
api_instance = openapi_client.AuthorizationApi()
apiRequestJwtTokenRequest = # ApiRequestJwtTokenRequest |
try:
api_response = api_instance.a/_jwt_token(apiRequestJwtTokenRequest)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthorizationApi->a. jwtToken: %s\n" % e)
extern crate AuthorizationApi;
pub fn main() {
let apiRequestJwtTokenRequest = ; // ApiRequestJwtTokenRequest
let mut context = AuthorizationApi::Context::default();
let result = client.a. jwtToken(apiRequestJwtTokenRequest, &context).wait();
println!("{:?}", result);
}
Области доступа
Параметры
Название | Описание |
---|---|
apiRequestJwtTokenRequest * |