38.4 VALIDATE Procedure
This procedure validates the given token.
Syntax
APEX_JWT.VALIDATE (
p_token IN t_token,
p_iss IN VARCHAR2 DEFAULT NULL,
p_aud IN VARCHAR2 DEFAULT NULL,
p_leeway_seconds IN PLS_INTEGER DEFAULT 0 );
Parameters
Parameter | Description |
---|---|
p_token |
The JWT. |
p_iss |
If not null, verify that the "iss" claim equals p_iss .
|
p_aud |
If not null, verify that the single "aud" value equals p_aud . If "aud" is an array, verify that the "azp" (Authorized Party) claim equals p_aud . This is an OpenID extension.
|
p_leeway_seconds |
Fudge factor (in seconds) for comparing "exp" (Expiration Time), "nbf" (Not Before), and "iat" (Issued At) claims.
|
Raises
VALUE_ERROR
: Validation failed, check debug log for details.
Example
Verify that l_value
is a valid OpenID
ID token.
DECLARE
l_value varchar2(4000) := 'eyJ0 ... NiJ9.eyJ1c ... I6IjIifX0.DeWt4Qu ... ZXso';
l_oauth2_client_id varchar2(30) := '...';
l_token apex_jwt.t_token;
BEGIN
l_token := apex_jwt.decode (
p_value => l_value );
apex_jwt.validate (
p_token => l_token,
p_aud => l_oauth2_client_id );
END;
Parent topic: APEX_JWT