import { Authlete } from "@authlete/typescript-sdk";
const authlete = new Authlete({
bearer: process.env["AUTHLETE_BEARER"] ?? "",
});
async function run() {
const result = await authlete.authorization.issue({
serviceId: "<id>",
authorizationIssueRequest: {
ticket: "FFgB9gwb_WXh6g1u-UQ8ZI-d_k4B-o-cm7RkVzI8Vnc",
subject: "john",
},
});
console.log(result);
}
run();require 'authlete_ruby_sdk'
Models = ::Authlete::Models
s = ::Authlete::Client.new(
bearer: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.authorization.issue_response(service_id: '<id>', authorization_issue_request: Models::Components::AuthorizationIssueRequest.new(
ticket: 'FFgB9gwb_WXh6g1u-UQ8ZI-d_k4B-o-cm7RkVzI8Vnc',
subject: 'john'
))
unless res.authorization_issue_response.nil?
# handle response
endpackage main
import(
"context"
"os"
authlete "github.com/authlete/authlete-go-sdk"
"github.com/authlete/authlete-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := authlete.New(
authlete.WithSecurity(os.Getenv("AUTHLETE_BEARER")),
)
res, err := s.Authorization.Issue(ctx, "<id>", components.AuthorizationIssueRequest{
Ticket: "FFgB9gwb_WXh6g1u-UQ8ZI-d_k4B-o-cm7RkVzI8Vnc",
Subject: "john",
})
if err != nil {
log.Fatal(err)
}
if res.AuthorizationIssueResponse != nil {
// handle response
}
}curl --request POST \
--url https://us.authlete.com/api/{serviceId}/auth/authorization/issue \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ticket": "<string>",
"subject": "<string>",
"authTime": 123,
"acr": "<string>",
"claims": "<string>",
"properties": [
{
"key": "<string>",
"value": "<string>",
"hidden": true
}
],
"scopes": [
"<string>"
],
"sub": "<string>",
"idtHeaderParams": "<string>",
"claimsForTx": "<string>",
"consentedClaims": [
"<string>"
],
"authorizationDetails": {
"elements": [
{
"type": "<string>",
"locations": [
"<string>"
],
"actions": [
"<string>"
],
"dataTypes": [
"<string>"
],
"identifier": "<string>",
"privileges": [
"<string>"
],
"otherFields": "<string>"
}
]
},
"jwtAtClaims": "<string>",
"accessToken": "<string>",
"accessTokenDuration": 123,
"sessionId": "<string>",
"idTokenAudType": "<string>",
"verifiedClaimsForTx": [
"<string>"
]
}
'{
"resultCode": "A040001",
"resultMessage": "[A040001] The authorization request was processed successfully.",
"accessTokenDuration": 0,
"accessTokenExpiresAt": 0,
"action": "LOCATION",
"authorizationCode": "Xv_su944auuBgc5mfUnxXayiiQU9Z4-T_Yae_UfExmo",
"responseContent": "https://my-client.example.com/cb1?code=Xv_su944auuBgc5mfUnxXayiiQU9Z4-T_Yae_UfExmo&iss=https%3A%2F%2Fmy-service.example.com"
}{
"resultCode": "A001201",
"resultMessage": "[A001201] /auth/authorization, TLS must be used."
}{
"resultCode": "A001202",
"resultMessage": "[A001202] /auth/authorization, Authorization header is missing."
}{
"resultCode": "A001215",
"resultMessage": "[A001215] /auth/authorization, The client (ID = 26837717140341) is locked."
}{
"resultCode": "A001311",
"resultMessage": "[A001311] /auth/authorization, Too many requests, retry after 1 seconds. (Entity: 23769878923/87122303)"
}{
"resultCode": "A001101",
"resultMessage": "[A001101] /auth/authorization, Authlete Server error."
}Issue Authorization Response
This API parses request parameters of an authorization request and returns necessary data for the authorization server implementation to process the authorization request further.
import { Authlete } from "@authlete/typescript-sdk";
const authlete = new Authlete({
bearer: process.env["AUTHLETE_BEARER"] ?? "",
});
async function run() {
const result = await authlete.authorization.issue({
serviceId: "<id>",
authorizationIssueRequest: {
ticket: "FFgB9gwb_WXh6g1u-UQ8ZI-d_k4B-o-cm7RkVzI8Vnc",
subject: "john",
},
});
console.log(result);
}
run();require 'authlete_ruby_sdk'
Models = ::Authlete::Models
s = ::Authlete::Client.new(
bearer: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.authorization.issue_response(service_id: '<id>', authorization_issue_request: Models::Components::AuthorizationIssueRequest.new(
ticket: 'FFgB9gwb_WXh6g1u-UQ8ZI-d_k4B-o-cm7RkVzI8Vnc',
subject: 'john'
))
unless res.authorization_issue_response.nil?
# handle response
endpackage main
import(
"context"
"os"
authlete "github.com/authlete/authlete-go-sdk"
"github.com/authlete/authlete-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := authlete.New(
authlete.WithSecurity(os.Getenv("AUTHLETE_BEARER")),
)
res, err := s.Authorization.Issue(ctx, "<id>", components.AuthorizationIssueRequest{
Ticket: "FFgB9gwb_WXh6g1u-UQ8ZI-d_k4B-o-cm7RkVzI8Vnc",
Subject: "john",
})
if err != nil {
log.Fatal(err)
}
if res.AuthorizationIssueResponse != nil {
// handle response
}
}curl --request POST \
--url https://us.authlete.com/api/{serviceId}/auth/authorization/issue \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ticket": "<string>",
"subject": "<string>",
"authTime": 123,
"acr": "<string>",
"claims": "<string>",
"properties": [
{
"key": "<string>",
"value": "<string>",
"hidden": true
}
],
"scopes": [
"<string>"
],
"sub": "<string>",
"idtHeaderParams": "<string>",
"claimsForTx": "<string>",
"consentedClaims": [
"<string>"
],
"authorizationDetails": {
"elements": [
{
"type": "<string>",
"locations": [
"<string>"
],
"actions": [
"<string>"
],
"dataTypes": [
"<string>"
],
"identifier": "<string>",
"privileges": [
"<string>"
],
"otherFields": "<string>"
}
]
},
"jwtAtClaims": "<string>",
"accessToken": "<string>",
"accessTokenDuration": 123,
"sessionId": "<string>",
"idTokenAudType": "<string>",
"verifiedClaimsForTx": [
"<string>"
]
}
'{
"resultCode": "A040001",
"resultMessage": "[A040001] The authorization request was processed successfully.",
"accessTokenDuration": 0,
"accessTokenExpiresAt": 0,
"action": "LOCATION",
"authorizationCode": "Xv_su944auuBgc5mfUnxXayiiQU9Z4-T_Yae_UfExmo",
"responseContent": "https://my-client.example.com/cb1?code=Xv_su944auuBgc5mfUnxXayiiQU9Z4-T_Yae_UfExmo&iss=https%3A%2F%2Fmy-service.example.com"
}{
"resultCode": "A001201",
"resultMessage": "[A001201] /auth/authorization, TLS must be used."
}{
"resultCode": "A001202",
"resultMessage": "[A001202] /auth/authorization, Authorization header is missing."
}{
"resultCode": "A001215",
"resultMessage": "[A001215] /auth/authorization, The client (ID = 26837717140341) is locked."
}{
"resultCode": "A001311",
"resultMessage": "[A001311] /auth/authorization, Too many requests, retry after 1 seconds. (Entity: 23769878923/87122303)"
}{
"resultCode": "A001101",
"resultMessage": "[A001101] /auth/authorization, Authlete Server error."
}Authorizations
Authenticate every request with a Service Access Token or Organization Token.
Set the token value in the Authorization: Bearer <token> header.
Service Access Token: Scoped to a single service. Use when automating service-level configuration or runtime flows.
Organization Token: Scoped to the organization; inherits permissions across services. Use for org-wide automation or when managing multiple services programmatically.
Both token types are issued by the Authlete console or provisioning APIs.
Path Parameters
A service ID.
Body
The ticket issued from Authlete /auth/authorization API.
The subject (= a user account managed by the service) who has granted authorization to the client application.
The time when the authentication of the end-user occurred. Its value is the number of seconds from 1970-01-01.
The Authentication Context Class Reference performed for the end-user authentication.
The claims of the end-user (= pieces of information about the end-user) in JSON format. See OpenID Connect Core 1.0, 5.1. Standard Claims for details about the format.
Extra properties to associate with an access token and/or an authorization code.
Show child attributes
Show child attributes
Scopes to associate with an access token and/or an authorization code. If a non-empty string array is given, it replaces the scopes specified by the original authorization request.
The value of the sub claim to embed in an ID token. If this request parameter is null or empty,
the value of the subject request parameter is used as the value of the sub claim.
JSON that represents additional JWS header parameters for ID tokens that may be issued based on the authorization request.
Claim key-value pairs that are used to compute transformed claims.
the claims that the user has consented for the client application to know.
The authorization details. This represents the value of the authorization_details
request parameter in the preceding device authorization request which is defined in
"OAuth 2.0 Rich Authorization Requests".
Show child attributes
Show child attributes
Additional claims that are added to the payload part of the JWT access token.
The representation of an access token that may be issued as a result of the Authlete API call.
The duration (in seconds) of the access token that may be issued as a result of the Authlete API call.
When this request parameter holds a positive integer, it is used as the duration of the access token in. In other cases, this request parameter is ignored.
The session ID of the user's authentication session. The specified value will be embedded in the
ID token as the value of the sid claim. This parameter needs to be provided only if you want
to support the OpenID Connect Native SSO for Mobile Apps 1.0
specification (a.k.a. "Native SSO"). To enable support for the Native SSO specification, the
nativeSsoSupported property of your service must be set to true.
The type of the aud claim of the ID token being issued. Valid values are as follows.
| Value | Description |
|---|---|
| "array" | The type of the aud claim is always an array of strings. |
| "string" | The type of the aud claim is always a single string. |
| null | The type of the aud claim remains the same as before. |
This request parameter takes precedence over the idTokenAudType property of the service.
Values of verified claims requested indirectly by "transformed claims".
Response
The code which represents the result of the API call.
A short message which explains the result of the API call.
The next action that the authorization server implementation should take.
INTERNAL_SERVER_ERROR, BAD_REQUEST, LOCATION, FORM The content that the authorization server implementation is to return to the client application.
Its format varies depending on the value of action parameter.
The newly issued access token. Note that an access token is issued from an authorization endpoint only
when response_type contains token.
The datetime at which the newly issued access token will expire. The value is represented in milliseconds since the Unix epoch (1970-01-01).
The duration of the newly issued access token in seconds.
The newly issued ID token. Note that an ID token is issued from an authorization endpoint only
when response_type contains id_token.
The newly issued authorization code. Note that an authorization code is issued only
when response_type contains code.
The newly issued access token in JWT format. If the service is not configured to issue JWT-based access tokens,
this property is always set to null.
The information about the ticket.
Show child attributes
Show child attributes
the claims that the user has consented for the client application to know.