-
Notifications
You must be signed in to change notification settings - Fork 37
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
Allow sdk redirect on settings actions #3827
Allow sdk redirect on settings actions #3827
Conversation
2cc5ce1
to
aa81537
Compare
db703db
to
0bf3a3b
Compare
@tung2744 @louischan-oursky Updated to reflect latest settings action spec, still adding test cases for new response type and grant type 🙏 |
84afb58
to
a55babf
Compare
a55babf
to
7dbc9fe
Compare
efb78ef
to
8a6c22a
Compare
cac1bb5
to
70da13b
Compare
211c791
to
28cefe1
Compare
Tried to create a stimulus controller that can override history items https://github.com/IniZio/authgear-server/tree/3813-settings-action-redirect-web The script itself works in other flows, but the consent page will block the In this pr, I inserted a |
6d3832f
to
ba267df
Compare
After discussion, will make web behave similarly as other platforms. Will guard back-navigation only at consent screen instead. Other screens will still show expired error for now. Changes:
|
ba267df
to
4e7b9b0
Compare
// Do not set anything. | ||
if redirectURI != consentURI { | ||
return redirectURI | ||
} |
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.
Why do we add this?
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.
It's in the original code, was removed in a temp commit for an old approach in this pr. New commit adds it back.
&nodes.EdgeDoEnsureSession{ | ||
Mode: nodes.EnsureSessionModeNoop, | ||
}, | ||
}, nil |
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.
Why do we need to add EdgeDoEnsureSession here?
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.
Currently it's possible to change password to same as previous value and still return as success. Or should it be treated as fail for settings action?
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.
I think it should be a success, but the developer could enable password history check, which should cause the flow to return api error. That should be handled by password policy already.
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.
Does this work? EdgeDoEnsureSession
should be irrelevant here.
case *nodes.NodeChangePasswordEnd:
// Password was not changed
return []interaction.Edge{&nodes.EdgeSettingsActionEnd{}}, nil
case *nodes.NodeDoUpdateAuthenticator:
return []interaction.Edge{&nodes.EdgeSettingsActionEnd{}}, nil
case *nodes.NodeSettingsActionEnd:
// Intent is finished.
return nil, nil
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.
Should still need, similar to IntentReauthenticate
. Tried removing it results in invalid authentication required
@@ -398,7 +428,7 @@ func (h *AuthorizationHandler) doHandle( | |||
// Handle prompt!=none | |||
// We must return here. | |||
if !slice.ContainsString(uiInfo.Prompt, "none") { | |||
endpoint, err := h.UIURLBuilder.Build(client, r, oauthSessionEntry) | |||
endpoint, err := h.UIURLBuilder.BuildAuthenticationURL(client, r, oauthSessionEntry) |
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.
We will remove parseAuthzRedirectURI, and in here, we will choose between BuildAuthenticationURL and BuildSettingsActionURL. In doing this, we preserve the original code flow, and let the reader to reason the code easier.
2fbd47d
to
a82f704
Compare
&nodes.EdgeDoEnsureSession{ | ||
Mode: nodes.EnsureSessionModeNoop, | ||
}, | ||
}, nil |
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.
Does this work? EdgeDoEnsureSession
should be irrelevant here.
case *nodes.NodeChangePasswordEnd:
// Password was not changed
return []interaction.Edge{&nodes.EdgeSettingsActionEnd{}}, nil
case *nodes.NodeDoUpdateAuthenticator:
return []interaction.Edge{&nodes.EdgeSettingsActionEnd{}}, nil
case *nodes.NodeSettingsActionEnd:
// Intent is finished.
return nil, nil
We now use implicitly whitelisted response types instead of client config
Return to user app if user visits expired oauth pages e.g. oauth consent. It mostly likely happens when users refresh on expired oauth page or go back after oauth flow has completed e.g. settings action.
d1fe865
to
dadf4dd
Compare
ref #3813
Initially wanted to apply this derive function on all settings sub-pages. However it will be odd to, for example close the webview on remove an identity in
/settings/identity
page