{"openapi": "3.1.0", "info": {"title": "NinjaAPI", "version": "1.0.0", "description": ""}, "paths": {"/auth/token/exchange/": {"post": {"operationId": "token_exchange_api_exchange", "summary": "Exchange", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TokenExchangeResponse"}}}}}, "description": "RFC 8693 Token Exchange endpoint.\n\nThis endpoint allows exchanging an external SSO token\nfor a new token with different audiences, scopes,\nor lifetime.\n\nPOST /auth/token/exchange/\n    Exchange a token according to RFC 8693", "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"title": "FormParams", "type": "object", "properties": {"subject_token": {"minLength": 1, "title": "Subject Token", "type": "string"}, "subject_token_type": {"enum": ["urn:ietf:params:oauth:token-type:access_token", "urn:ietf:params:oauth:token-type:jwt"], "title": "AllowedSubjectTokenType", "type": "string"}, "grant_type": {"const": "urn:ietf:params:oauth:grant-type:token-exchange", "title": "Grant Type", "type": "string"}, "resource": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Resource"}, "audience": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Audience"}, "scope": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Scope"}, "requested_token_type": {"anyOf": [{"$ref": "#/components/schemas/AllowedRequestedTokenType"}, {"type": "null"}]}, "actor_token": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Actor Token"}, "actor_token_type": {"anyOf": [{"$ref": "#/components/schemas/AllowedActorTokenType"}, {"type": "null"}]}}, "required": ["subject_token", "subject_token_type", "grant_type"]}}}, "required": true}, "security": [{"ServiceProviderBasicAuthentication": []}]}}, "/auth/token/introspect/": {"post": {"operationId": "token_exchange_api_introspect", "summary": "Introspect", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntrospectionResponse"}}}}}, "description": "RFC 7662 Token Introspection endpoint.\n\nThis endpoint allows validating exchanged tokens and retrieving\ntheir metadata.\n\nPOST /auth/token/introspect/\n    Introspect a token according to RFC 7662", "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"title": "FormParams", "type": "object", "properties": {"token": {"pattern": "^\\S+$", "title": "Token", "type": "string"}, "token_type_hint": {"anyOf": [{"$ref": "#/components/schemas/TokenExchangeTokenTypeHint"}, {"type": "null"}]}}, "required": ["token"]}}}, "required": true}, "security": [{"ServiceProviderBasicAuthentication": []}]}}, "/auth/token/revoke/": {"post": {"operationId": "token_exchange_api_revoke", "summary": "Revoke", "parameters": [], "responses": {"200": {"description": "OK"}}, "description": "RFC 7009 Token Revocation endpoint.\n\nThis endpoint allows revoking exchanged tokens before their\nnatural expiration. Only the service that requested the token\nexchange (the source service) is allowed to revoke a token.\n\nPOST /auth/token/revoke/\n    Revoke a token according to RFC 7009", "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"title": "FormParams", "type": "object", "properties": {"token": {"pattern": "^\\S+$", "title": "Token", "type": "string"}, "token_type_hint": {"anyOf": [{"$ref": "#/components/schemas/TokenExchangeTokenTypeHint"}, {"type": "null"}]}}, "required": ["token"]}}}, "required": true}, "security": [{"ServiceProviderBasicAuthentication": []}]}}}, "components": {"schemas": {"AllowedRequestedTokenType": {"enum": ["urn:ietf:params:oauth:token-type:access_token", "urn:ietf:params:oauth:token-type:jwt"], "title": "AllowedRequestedTokenType", "type": "string"}, "TokenExchangeResponse": {"description": "Token exchange response.\n\nReference:\nhttps://www.rfc-editor.org/info/rfc8693/#name-response", "properties": {"access_token": {"title": "Access Token", "type": "string"}, "issued_token_type": {"$ref": "#/components/schemas/AllowedRequestedTokenType"}, "token_type": {"$ref": "#/components/schemas/TokenExchangeResponseTokenType"}, "expires_in": {"default": 3600, "maximum": 1296000, "title": "Expires In", "type": "integer"}, "scope": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Scope"}, "refresh_token": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Refresh Token"}}, "required": ["access_token", "issued_token_type", "token_type"], "title": "TokenExchangeResponse", "type": "object"}, "TokenExchangeResponseTokenType": {"description": "Token exchange response token_types allowed values.", "enum": ["bearer", "mac", "N_A"], "title": "TokenExchangeResponseTokenType", "type": "string"}, "AllowedActorTokenType": {"enum": ["urn:ietf:params:oauth:token-type:access_token", "urn:ietf:params:oauth:token-type:jwt"], "title": "AllowedActorTokenType", "type": "string"}, "AllowedSubjectTokenType": {"enum": ["urn:ietf:params:oauth:token-type:access_token", "urn:ietf:params:oauth:token-type:jwt"], "title": "AllowedSubjectTokenType", "type": "string"}, "TokenExchangeRequest": {"description": "Token exchange request.\n\nReference:\nhttps://www.rfc-editor.org/info/rfc8693/#name-request", "properties": {"subject_token": {"minLength": 1, "title": "Subject Token", "type": "string"}, "subject_token_type": {"$ref": "#/components/schemas/AllowedSubjectTokenType"}, "grant_type": {"const": "urn:ietf:params:oauth:grant-type:token-exchange", "title": "Grant Type", "type": "string"}, "resource": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Resource"}, "audience": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Audience"}, "scope": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Scope"}, "requested_token_type": {"anyOf": [{"$ref": "#/components/schemas/AllowedRequestedTokenType"}, {"type": "null"}]}, "actor_token": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Actor Token"}, "actor_token_type": {"anyOf": [{"$ref": "#/components/schemas/AllowedActorTokenType"}, {"type": "null"}]}}, "required": ["subject_token", "subject_token_type", "grant_type"], "title": "TokenExchangeRequest", "type": "object"}, "IntrospectionResponse": {"description": "Introspection response.\n\nReference:\nhttps://www.rfc-editor.org/info/rfc7662/#section-2.2", "properties": {"active": {"title": "Active", "type": "boolean"}, "sub": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "string"}, {"type": "null"}], "title": "Sub"}, "client_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Client Id"}, "scope": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Scope"}, "exp": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Exp"}, "iat": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Iat"}, "iss": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Iss"}, "aud": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Aud"}, "token_type": {"anyOf": [{"$ref": "#/components/schemas/IntrospectionResponseTokenType"}, {"type": "null"}]}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "username": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Username"}, "jti": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "string"}, {"type": "null"}], "title": "Jti"}}, "required": ["active"], "title": "IntrospectionResponse", "type": "object"}, "IntrospectionResponseTokenType": {"description": "Introspected token type.\n\nWhen introspecting a token it may be a subject or exchanged token. In the first case,\nit may be a bearer or mac token, while in the second case, it may be one of the supported\nexchanged token types.", "enum": ["bearer", "mac", "urn:ietf:params:oauth:token-type:access_token", "urn:ietf:params:oauth:token-type:refresh_token", "urn:ietf:params:oauth:token-type:jwt", "urn:ietf:params:oauth:token-type:id_token", "urn:ietf:params:oauth:token-type:saml1", "urn:ietf:params:oauth:token-type:saml2"], "title": "IntrospectionResponseTokenType", "type": "string"}, "IntrospectionRequest": {"description": "Exchanged token introspection request.\n\nReference:\nhttps://www.rfc-editor.org/info/rfc7662/#section-2.1", "properties": {"token": {"pattern": "^\\S+$", "title": "Token", "type": "string"}, "token_type_hint": {"anyOf": [{"$ref": "#/components/schemas/TokenExchangeTokenTypeHint"}, {"type": "null"}]}}, "required": ["token"], "title": "IntrospectionRequest", "type": "object"}, "TokenExchangeTokenTypeHint": {"description": "Token type hint used for token introspection (RFC 7662) and revocation (RFC 7009).", "enum": ["access_token", "refresh_token", "jwt"], "title": "TokenExchangeTokenTypeHint", "type": "string"}, "RevocationRequest": {"description": "Exchanged token revocation request.\n\nReference:\nhttps://www.rfc-editor.org/info/rfc7009/#section-2.1", "properties": {"token": {"pattern": "^\\S+$", "title": "Token", "type": "string"}, "token_type_hint": {"anyOf": [{"$ref": "#/components/schemas/TokenExchangeTokenTypeHint"}, {"type": "null"}]}}, "required": ["token"], "title": "RevocationRequest", "type": "object"}}, "securitySchemes": {"ServiceProviderBasicAuthentication": {"type": "http", "scheme": "basic"}}}, "servers": []}