forked from Github-Mirrors/canaille
Token introspection testfile
This commit is contained in:
parent
8880c92226
commit
b3abe210a5
1 changed files with 22 additions and 0 deletions
22
tests/test_token_introspection.py
Normal file
22
tests/test_token_introspection.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from . import client_credentials
|
||||
|
||||
|
||||
def test_token_introspection(testclient, user, client, token, slapd_connection):
|
||||
res = testclient.post(
|
||||
"/oauth/introspect",
|
||||
params=dict(token=token.oauthAccessToken,),
|
||||
headers={"Authorization": f"Basic {client_credentials(client)}"},
|
||||
)
|
||||
assert 200 == res.status_code
|
||||
assert {
|
||||
"active": True,
|
||||
"client_id": token.oauthClientID,
|
||||
"token_type": token.oauthTokenType,
|
||||
"username": user.name,
|
||||
"scope": token.get_scope(),
|
||||
"sub": token.oauthSubject,
|
||||
"aud": token.oauthClientID,
|
||||
"iss": "https://mydomain.tld",
|
||||
"exp": token.get_expires_at(),
|
||||
"iat": token.get_issued_at(),
|
||||
} == res.json
|
Loading…
Reference in a new issue