From 964d649d3d6db5032186dc3ebb6cf4f619ea0057 Mon Sep 17 00:00:00 2001 From: juanifioren Date: Tue, 3 Mar 2015 13:39:32 -0300 Subject: [PATCH] Remove client from sub generator. --- doc.md | 2 +- oidc_provider/lib/endpoints/token.py | 3 +-- oidc_provider/settings.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc.md b/doc.md index 546bfa1..464981a 100644 --- a/doc.md +++ b/doc.md @@ -132,7 +132,7 @@ Default is `60*10`. OPTIONAL. Subject Identifier. A locally unique and never reassigned identifier within the Issuer for the End-User, which is intended to be consumed by the Client. Is a function that receives both `user` and `client` objects. Default is: ```python -def default_sub_generator(user, client): +def default_sub_generator(user): return user.id ``` diff --git a/oidc_provider/lib/endpoints/token.py b/oidc_provider/lib/endpoints/token.py index 37eaf44..d2c3582 100644 --- a/oidc_provider/lib/endpoints/token.py +++ b/oidc_provider/lib/endpoints/token.py @@ -58,8 +58,7 @@ class TokenEndpoint(object): def create_response_dic(self): sub = settings.get('OIDC_IDTOKEN_SUB_GENERATOR')( - user=self.code.user, - client=self.client) + user=self.code.user) id_token_dic = create_id_token( iss=settings.get('SITE_URL'), diff --git a/oidc_provider/settings.py b/oidc_provider/settings.py index a661890..d2d1209 100644 --- a/oidc_provider/settings.py +++ b/oidc_provider/settings.py @@ -3,7 +3,7 @@ from django.conf import settings from oidc_provider.lib.claims import AbstractScopeClaims -def default_sub_generator(user, client): +def default_sub_generator(user): return user.id