We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9afd975 commit ffd68b8Copy full SHA for ffd68b8
rest_framework_sso/utils.py
@@ -41,8 +41,10 @@ def encode_jwt_token(payload):
41
raise RuntimeError('IDENTITY must be specified in settings')
42
43
if not payload.get('aud'):
44
- if api_settings.SESSION_AUDIENCE is not None:
+ if payload.get('type') == 'session' and api_settings.SESSION_AUDIENCE is not None:
45
payload['aud'] = api_settings.SESSION_AUDIENCE
46
+ elif payload.get('type') == 'auth' and api_settings.AUTHORIZATION_AUDIENCE is not None:
47
+ payload['aud'] = api_settings.AUTHORIZATION_AUDIENCE
48
elif api_settings.IDENTITY is not None:
49
payload['aud'] = [api_settings.IDENTITY]
50
else:
0 commit comments