forked from Github-Mirrors/canaille
Merge branch 'issue-64-introspection-sub' into 'master'
Fixed introspection sub claim. Fix #64 Closes #64 See merge request yaal/canaille!7
This commit is contained in:
commit
22f18f8cf2
2 changed files with 4 additions and 3 deletions
|
@ -243,13 +243,14 @@ class IntrospectionEndpoint(_IntrospectionEndpoint):
|
||||||
|
|
||||||
def introspect_token(self, token):
|
def introspect_token(self, token):
|
||||||
client_id = Client.get(token.oauthClient).oauthClientID
|
client_id = Client.get(token.oauthClient).oauthClientID
|
||||||
|
user = User.get(dn=token.oauthSubject)
|
||||||
return {
|
return {
|
||||||
"active": True,
|
"active": True,
|
||||||
"client_id": client_id,
|
"client_id": client_id,
|
||||||
"token_type": token.oauthTokenType,
|
"token_type": token.oauthTokenType,
|
||||||
"username": User.get(dn=token.oauthSubject).name,
|
"username": user.name,
|
||||||
"scope": token.get_scope(),
|
"scope": token.get_scope(),
|
||||||
"sub": token.oauthSubject,
|
"sub": user.uid[0],
|
||||||
"aud": client_id,
|
"aud": client_id,
|
||||||
"iss": authorization.metadata["issuer"],
|
"iss": authorization.metadata["issuer"],
|
||||||
"exp": token.get_expires_at(),
|
"exp": token.get_expires_at(),
|
||||||
|
|
|
@ -14,7 +14,7 @@ def test_token_introspection(testclient, user, client, token):
|
||||||
"token_type": token.oauthTokenType,
|
"token_type": token.oauthTokenType,
|
||||||
"username": user.name,
|
"username": user.name,
|
||||||
"scope": token.get_scope(),
|
"scope": token.get_scope(),
|
||||||
"sub": token.oauthSubject,
|
"sub": user.uid[0],
|
||||||
"aud": client.oauthClientID,
|
"aud": client.oauthClientID,
|
||||||
"iss": "https://mydomain.tld",
|
"iss": "https://mydomain.tld",
|
||||||
"exp": token.get_expires_at(),
|
"exp": token.get_expires_at(),
|
||||||
|
|
Loading…
Reference in a new issue