View Source oidcc_jwt_util (Oidcc v3.2.0)

JWT Utilities

Summary

Types

-type claims() :: #{binary() => term()}.
-type error() ::
    no_matching_key | invalid_jwt_token |
    {no_matching_key_with_kid, Kid :: binary()} |
    none_alg_used |
    {none_alg_used,
     Jwt :: #jose_jwt{fields :: map()},
     Jws ::
         #jose_jws{alg :: undefined | {module(), any()},
                   b64 :: undefined | boolean(),
                   fields :: map()}} |
    not_encrypted.
Link to this type

refresh_jwks_for_unknown_kid_fun/0

View Source
-type refresh_jwks_for_unknown_kid_fun() ::
    fun((Jwks :: jose_jwk:key(), Kid :: binary()) -> {ok, jose_jwk:key()} | {error, term()}).

Functions

Link to this function

decrypt_and_verify(Jwt, Jwks, SigningAlgs, EncryptionAlgs, EncryptionEncs)

View Source
-spec decrypt_and_verify(Jwt :: binary(),
                   Jwks :: jose_jwk:key(),
                   SigningAlgs :: [binary()] | undefined,
                   EncryptionAlgs :: [binary()] | undefined,
                   EncryptionEncs :: [binary()] | undefined) ->
                      {ok,
                       {#jose_jwt{fields :: map()},
                        #jose_jwe{alg :: undefined | {module(), any()},
                                  enc :: undefined | {module(), any()},
                                  zip :: undefined | {module(), any()},
                                  fields :: map()} |
                        #jose_jws{alg :: undefined | {module(), any()},
                                  b64 :: undefined | boolean(),
                                  fields :: map()}}} |
                      {error, error()}.