Projet

Général

Profil

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

Paul Marillonnet, 31 mars 2020 15:52

Télécharger (1,1 ko)

Voir les différences:

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

 src/authentic2_auth_oidc/utils.py | 10 ++++++++++
 1 file changed, 10 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
        if provider:
132
            try:
133
                parsed = parse_id_token(self._encoded, provider)
134
            except JWException as e:
135
                if raises:
136
                    raise IDTokenError(e)
137
                parsed = {}
138
        return parsed
139

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