-
-
Notifications
You must be signed in to change notification settings - Fork 560
Add support to SOCIAL_AUTH_OIDC_PROMPT and others #1127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add support to SOCIAL_AUTH_OIDC_PROMPT and others #1127
Conversation
A PR with documentation was sent, see python-social-auth/social-docs#288. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1127 +/- ##
==========================================
- Coverage 77.87% 77.69% -0.19%
==========================================
Files 353 353
Lines 10794 10845 +51
Branches 471 484 +13
==========================================
+ Hits 8406 8426 +20
- Misses 2222 2246 +24
- Partials 166 173 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If warnings were meant to indicate errors in the configuration, I think it's better to fail directly. Nobody will notice warnings.
As for the tests, it could check whether the configured parameters are included in the request to the authentication server.
ea244d6
to
36e841d
Compare
Thanks for the feedback. I expanded to match the list of parameters explicitly mentioned in the Authentication Request section. I don't implemented all parameters because of my limited knowledge of OpenID. |
New exceptions were defined. |
display = self.setting("DISPLAY", default=self.DISPLAY) | ||
if display is not None: | ||
if not display: | ||
raise AuthMissingParameter("OpenID Connect display value cannot be empty string.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK these should take self
as a first parameter.
class AuthInvalidParameter(AuthException): | ||
"""Invalid value for parameter to start or complete the process.""" | ||
|
||
def __init__(self, backend, parameter, *args, **kwargs): | ||
self.parameter = parameter | ||
super().__init__(backend, *args, **kwargs) | ||
|
||
def __str__(self): | ||
return f"Invalid value for parameter {self.parameter}" | ||
|
||
|
||
class AuthNotImplementedParameter(AuthException): | ||
"""Optional parameter not implemented to start or complete the process.""" | ||
|
||
def __init__(self, backend, parameter, *args, **kwargs): | ||
self.parameter = parameter | ||
super().__init__(backend, *args, **kwargs) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's reuse constructor logic:
class AuthInvalidParameter(AuthException): | |
"""Invalid value for parameter to start or complete the process.""" | |
def __init__(self, backend, parameter, *args, **kwargs): | |
self.parameter = parameter | |
super().__init__(backend, *args, **kwargs) | |
def __str__(self): | |
return f"Invalid value for parameter {self.parameter}" | |
class AuthNotImplementedParameter(AuthException): | |
"""Optional parameter not implemented to start or complete the process.""" | |
def __init__(self, backend, parameter, *args, **kwargs): | |
self.parameter = parameter | |
super().__init__(backend, *args, **kwargs) | |
class AuthInvalidParameter(AuthMissingParameter): | |
"""Invalid value for parameter to start or complete the process.""" | |
def __str__(self): | |
return f"Invalid value for parameter {self.parameter}" | |
class AuthNotImplementedParameter(AuthMissingParameter): | |
"""Optional parameter not implemented to start or complete the process.""" | |
This is related to #1124.
This is my first PR to this project. Feedback is welcome, specially regarding
If this PR looks good, I will submit others to complete #1124.