line_bot v0.1.0 LineBot.TokenServer View Source
A GenServer that manages the OAuth token for Line API calls.
This server is started automatically by the :line_bot
application, and requires the
:client_id
, and :client_secret
to have been configured.
The current token is retrieved with get_token/0
, which also fetches a new token from the auth
server if the current one has expired (or has never been fetched).
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Gets the currently stored token. If the token has expired, a new token is retrieved.
Purges the current access token. This only removes the token from this process' state, it does not revoke the token.
Revokes the current access token. This revokes the token with the API server, so the token will become invalid and cannot be used elsewhere.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Gets the currently stored token. If the token has expired, a new token is retrieved.
Purges the current access token. This only removes the token from this process' state, it does not revoke the token.
A new token will be retrieved on the next call to get_token/0
.
To revoke the token, use revoke_token/0
.
Revokes the current access token. This revokes the token with the API server, so the token will become invalid and cannot be used elsewhere.
A new token will be retrieved on the next call
to get_token/0
.