Comments (5)
Yeah I use the scopes prop to pass. I will create a PR for rest. Maybe good approach would be to add any common oauth ones to config
and maybe the rest as a new property called params
or something?
from yew-oauth2.
I'm encountered a similar problem when working with Discords OAuth2, where there is a query option prompt=none
which requires the user to allow app permission only once. This works fine for login purposes as we can just use start_login_opts(...)
, but this doesnt work when there is an redirect because of unauthenticated state.
I was able to cover this problem locally by introducing LoginOptions as property of the OAuth2 struct like this:
` let mut hashmap = HashMap::new();
hashmap.insert("prompt".to_string(), "none".to_string());
let options = LoginOptions { query: hashmap };
html!(
<>
<OAuth2 {config} {scopes} {options}>
...`
I can provide a PR with the changes made, if that way looks fine.
from yew-oauth2.
I think most of the parameters are standard OAuth2 parameters, which will be set automatically.
But you are right, some of them (like scope) and arbitrary custom parameter can currently not be set. I think it would make sense to amend this though. Would be you able to come up with a PR?
from yew-oauth2.
Actually you can set scopes, I was looking in the wrong location 🤦 …
yew-oauth2/src/components/context.rs
Line 18 in 49d3573
For the other parameters, it might make sense to either amend the Config
structure. Or, if they are more generic, add them to the component properties too.
from yew-oauth2.
As PR #9 is merged and released, can we close this issue?
from yew-oauth2.
Related Issues (17)
- Authentication State Doesn't Persist Through Page Refresh HOT 7
- OpenID Connect Client authentication HOT 1
- Store and Reuse AccessToken for Silent Login HOT 1
- redirect_uri_mismatch HOT 7
- Not configurable 'redirect_url' for a openidclient HOT 5
- Support yew 0.21 HOT 1
- Router seems to work fine without the router feature HOT 2
- 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
- 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
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.