16.10 SET_PERSISTENT_TOKEN Procedure
This procedure sets a token into the provided credential persistently, beyond the current Oracle APEX session. The token is encrypted for security. Client ID and Client Secret are not stored in the credential store by this procedure.
Syntax
APEX_CREDENTIAL.SET_PERSISTENT_TOKEN (
p_credential_static_id IN VARCHAR2,
p_token_type IN t_token_type,
p_token_value IN VARCHAR2,
p_token_expires IN DATE );
Parameters
Parameters | Description |
---|---|
p_credential_static_id |
The credential static ID. |
p_token_type |
One of the constants C_TOKEN_ACCESS , C_TOKEN_REFRESH , or C_TOKEN_ID .
|
p_token_value |
The token value. |
p_token_expires |
The token expiry date. |
Example
The following example stores the OAuth2 access token with value sdakjjkhw7632178jh12hs876e38..
and expiry date of 2023-10-31
into the credential OAuth Login
.
BEGIN
apex_credential.set_persistent_token (
p_credential_static_id => 'OAuth Login',
p_token_type => apex_credential.C_TOKEN_ACCESS,
p_token_value => 'sdakjjkhw7632178jh12hs876e38..',
p_token_expires => to_date('2023-10-31', 'YYYY-MM-DD') );
END;
Parent topic: APEX_CREDENTIAL