From 422a2712a7a1e87efe6d019255d386a3bb21c9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20B=C5=99ou=C5=A1ek?= Date: Mon, 1 Nov 2021 15:24:01 +0100 Subject: [PATCH] docs: add prompt to refresh token requirements --- docs/source/contents/usage.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/source/contents/usage.md b/docs/source/contents/usage.md index 795cc0d3..6e7faa4e 100644 --- a/docs/source/contents/usage.md +++ b/docs/source/contents/usage.md @@ -52,8 +52,9 @@ We can even test the single logout Refresh token ------------- -Here an example about how to refresh a token. -It is important to consider that only scope=offline_access will get a usable refresh token. +To obtain a refresh token, you have to use `response_type=code`, add `offline_access` to `scope` and also use `prompt=consent`, otherwise there will be an error (based on [OpenID Connect specification](https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.11)). + +To refresh a token: import requests @@ -73,7 +74,7 @@ It is important to consider that only scope=offline_access will get a usable ref 'https://127.0.0.1:8000/oidcop/token', verify=False, data=data, headers=headers ) -oidc-op will return a json response like this:: +oidc-op will return a json response like this: { 'access_token': 'eyJhbGc ... CIOH_09tT_YVa_gyTqg',