Comments (5)
The redirect URL is actually constructed from the current URL:
Lines 378 to 384 in 06a652f
But I agree, it might make sense to be able to override this.
There are different ways to deal with this. This could be configured in the oauth2 main configuration, via an optionally provided URL. Or using an optionally provided relative URL maybe. It could also be provided in the LoginOptions
struct. What do you think?
from yew-oauth2.
@ctron I think more convenient way is to have it at Client config level. You concept of 'Additional', right? That make sense to me put ALL optional additional configurations into this structure with 'predefined' default values. Any other solutions will be less attractive to me.
#[cfg(feature = "openid")] let config = Config { client_id: "XYZ".into(), //Rust OKTA as SPA configuration issuer_url: "https://XYZ-dev.okta.com/oauth2/default".into(), additional: Additional { /* Set the after logout URL to a public URL. Otherwise, the SSO server will redirect back to the current page, which is detected as a new session, and will try to login again, if the page requires this. */ end_session_url: None, after_logout_url: Some("/".into()), post_logout_redirect_name: Some("/".into()), redirect_uri: Some("/login/oauth2/code/okta".into()), ///Other Okta related configs }, };
from yew-oauth2.
Yea, that is true. However, we already have the scope
on the OAuth2
component properties level (as it is the same for both OAuth2 and OIDC). And now the same for the audience.
However, that doesn't matter as a default can be defined using #[prop_or_default]
(or similar attributes).
Maybe it makes sense to define this as Option
on both the OAuth2
properties, as well as the LoginOptions
, defaulting to the current behavior.
from yew-oauth2.
@ctron I don't want to limit you in solution. It makes sense to me for any convenient approach. Just provide in doc several examples how to configure for different use cases.
from yew-oauth2.
I won't promise anything, but if you have some time, a PR would definitely help.
from yew-oauth2.
Related Issues (18)
- Authentication State Doesn't Persist Through Page Refresh HOT 7
- Router seems to work fine without the router feature HOT 2
- Client secret param
- Add support for the Next (after 0.19) version of Yew HOT 12
- Provide a way to redirect when not logged in
- Notes on using examples HOT 3
- Could `Config::token_url` be made optional? HOT 5
- Supporting Google OAuth2 HOT 5
- OpenID Connect Client authentication HOT 1
- Store and Reuse AccessToken for Silent Login HOT 1
- redirect_uri_mismatch HOT 7
- Support yew 0.21 HOT 1
- Time not implemented on this platform on yew-oauth2-example HOT 3
- Using Auth0 as IDP and manage on Client the redirection. HOT 17
- post_login_redirect doesn't actually redirect if the callback is not used HOT 4
- How to retrieve additional claims from the ID token? HOT 4
- Refresh of access token issue HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yew-oauth2.