Package com.linecorp.bot.client
Interface LineOAuthClient
public interface LineOAuthClient
An OAuth client that issues or revokes channel access tokens. See
document
for detail.
-
Method Summary
Modifier and TypeMethodDescriptionstatic LineOAuthClientBuilder
builder()
Creates aLineOAuthClientBuilder
.CompletableFuture<com.linecorp.bot.model.oauth.ChannelAccessTokenKeyIdsResponse>
Gets all valid channel access token key IDs.CompletableFuture<com.linecorp.bot.model.oauth.IssueChannelAccessTokenResponse>
issueChannelToken
(com.linecorp.bot.model.oauth.IssueChannelAccessTokenRequest req) Issues a short-lived channel access token.CompletableFuture<com.linecorp.bot.model.oauth.IssueChannelAccessTokenResponse>
issueChannelTokenByJWT
(String clientAssertion) Issues a channel access token.revokeChannelToken
(String accessToken) Revokes a channel access token.revokeChannelTokenByJWT
(String clientId, String clientSecret, String accessToken) Revokes a channel access token.
-
Method Details
-
builder
Creates aLineOAuthClientBuilder
. -
getsAllValidChannelAccessTokenKeyIdsByJWT
CompletableFuture<com.linecorp.bot.model.oauth.ChannelAccessTokenKeyIdsResponse> getsAllValidChannelAccessTokenKeyIdsByJWT(String jwt) Gets all valid channel access token key IDs.- Parameters:
jwt
- A JSON Web Token (JWT) (opens new window)the client needs to create and sign with the private key.- Returns:
- Get all valid channel access token key IDs v2.1
-
issueChannelTokenByJWT
CompletableFuture<com.linecorp.bot.model.oauth.IssueChannelAccessTokenResponse> issueChannelTokenByJWT(String clientAssertion) Issues a channel access token. This method lets you use JWT assertion for authentication.You can issue up to 30 tokens. If you reach the maximum limit, additional requests of issuing channel access tokens are blocked.
- Parameters:
clientAssertion
- A JSON Web Token the client needs to create and sign with the private key created when issuing an assertion signing key.- See Also:
-
revokeChannelTokenByJWT
CompletableFuture<Void> revokeChannelTokenByJWT(String clientId, String clientSecret, String accessToken) Revokes a channel access token.- Parameters:
clientId
- Channel IDclientSecret
- Channel SecretaccessToken
- Channel access token- See Also:
-
issueChannelToken
CompletableFuture<com.linecorp.bot.model.oauth.IssueChannelAccessTokenResponse> issueChannelToken(com.linecorp.bot.model.oauth.IssueChannelAccessTokenRequest req) Issues a short-lived channel access token. Up to 30 tokens can be issued. If the maximum is exceeded, existing channel access tokens are revoked in the order of when they were first issued. It will return a failedCompletableFuture
withChannelAccessTokenException
if it has an error during calling the API. -
revokeChannelToken
Revokes a channel access token. It will return a failedCompletableFuture
withChannelAccessTokenException
if it has an error during calling the API.
-