Skip to content

Commit 091b2a1

Browse files
authored
Add POST /oauth2/v3/token (issue stateless channel token) API (#30)
Modification: A new channel access token type, `stateless channel access token`, was added and now brought to public as described in https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token This commit adds the OpenAPI definition for the newly added token type. --------- Co-authored-by: KS. Yim <ks.yim@linecorp.com>
1 parent 2fbbdd1 commit 091b2a1

File tree

1 file changed

+97
-2
lines changed

1 file changed

+97
-2
lines changed

channel-access-token.yml

Lines changed: 97 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,37 @@ tags:
1616
- name: channel-access-token
1717

1818
paths:
19+
"/oauth2/v3/token":
20+
post:
21+
externalDocs:
22+
url: https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token
23+
tags:
24+
- channel-access-token
25+
operationId: issueStatelessChannelToken
26+
description: |
27+
Issues a new stateless channel access token, which doesn't have max active token limit
28+
unlike the other token types.
29+
The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires.
30+
requestBody:
31+
required: true
32+
content:
33+
application/x-www-form-urlencoded:
34+
schema:
35+
oneOf:
36+
- $ref: '#/components/schemas/IssueStatelessChannelTokenByJWTAssertionRequest'
37+
- $ref: '#/components/schemas/IssueStatelessChannelTokenByClientSecretRequest'
38+
responses:
39+
"200":
40+
description: "OK"
41+
content:
42+
application/json:
43+
schema:
44+
"$ref": "#/components/schemas/IssueStatelessChannelAccessTokenResponse"
45+
example:
46+
token_type: Bearer
47+
access_token: eyJhbGciOiJIUz.....
48+
expires_in: 899
49+
1950
"/oauth2/v2.1/tokens/kid":
2051
get:
2152
externalDocs:
@@ -256,6 +287,71 @@ components:
256287
description: "Channel access token"
257288

258289
schemas:
290+
IssueStatelessChannelTokenByJWTAssertionRequest:
291+
externalDocs:
292+
url: https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token
293+
description: "Request body to issue a new token with JWT assertion"
294+
type: object
295+
required:
296+
- grant_type
297+
- client_assertion
298+
- client_assertion_type
299+
properties:
300+
grant_type:
301+
type: string
302+
enum: [ client_credentials ]
303+
description: "client_credentials"
304+
client_assertion_type:
305+
type: string
306+
enum: [ urn:ietf:params:oauth:client-assertion-type:jwt-bearer ]
307+
description: "URL-encoded value of `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`"
308+
client_assertion:
309+
type: string
310+
description: "A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key."
311+
IssueStatelessChannelTokenByClientSecretRequest:
312+
externalDocs:
313+
url: https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token
314+
description: "Request body to issue a new token with `client_id` and `client_secret`"
315+
type: object
316+
required:
317+
- grant_type
318+
- client_id
319+
- client_secret
320+
properties:
321+
grant_type:
322+
type: string
323+
enum: [ client_credentials ]
324+
description: "`client_credentials`"
325+
client_id:
326+
type: string
327+
description: "Channel ID."
328+
client_secret:
329+
type: string
330+
description: "Channel secret."
331+
IssueStatelessChannelAccessTokenResponse:
332+
externalDocs:
333+
url: https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token
334+
description: "Issued stateless channel access token"
335+
required:
336+
- access_token
337+
- expires_in
338+
- token_type
339+
type: object
340+
properties:
341+
access_token:
342+
type: string
343+
description: |+
344+
A stateless channel access token.
345+
The token is an opaque string which means its format is an implementation detail
346+
and the consumer of this token should never try to use the data parsed from the token.
347+
expires_in:
348+
type: integer
349+
format: int32
350+
description: "Duration in seconds after which the issued access token expires"
351+
token_type:
352+
type: string
353+
default: Bearer
354+
description: "Token type. The value is always `Bearer`."
259355
ChannelAccessTokenKeyIdsResponse:
260356
externalDocs:
261357
url: https://developers.line.biz/en/reference/messaging-api/#get-all-valid-channel-access-token-key-ids-v2-1
@@ -291,7 +387,7 @@ components:
291387
token_type:
292388
type: string
293389
default: Bearer
294-
description: "A token type. `Bearer`"
390+
description: "Token type. The value is always `Bearer`."
295391
IssueChannelAccessTokenResponse:
296392
externalDocs:
297393
url: https://developers.line.biz/en/reference/messaging-api/#issue-channel-access-token-v2-1
@@ -346,4 +442,3 @@ components:
346442
error_description:
347443
description: "Details of the error. Not returned in certain situations."
348444
type: string
349-

0 commit comments

Comments
 (0)