Projet

Général

Profil

0004-auth_oidc-add-id-token-as_dict-method-37871.patch

Paul Marillonnet, 31 mars 2020 18:03

Télécharger (1,05 ko)

Voir les différences:

Subject: [PATCH 4/5] auth_oidc: add id token 'as_dict' method (#37871)

 src/authentic2_auth_oidc/utils.py | 9 +++++++++
 1 file changed, 9 insertions(+)
src/authentic2_auth_oidc/utils.py
127 127
                    _('Encoded ID Token must be either binary or string data'))
128 128
        self._encoded = encoded
129 129

  
130
    def as_dict(self, provider, raises=False):
131
        try:
132
            parsed = parse_id_token(self._encoded, provider)
133
        except JWException as e:
134
            if raises:
135
                raise IDTokenError(e)
136
            parsed = {}
137
        return parsed
138

  
130 139
    def deserialize(self, provider):
131 140
        try:
132 141
            decoded = parse_id_token(self._encoded, provider)
133
-