Skip to content

client config: make state parameter optional#284

Open
balland wants to merge 1 commit into
p2:developfrom
balland:state-param-optional
Open

client config: make state parameter optional#284
balland wants to merge 1 commit into
p2:developfrom
balland:state-param-optional

Conversation

@balland

@balland balland commented Sep 14, 2018

Copy link
Copy Markdown

The state parameter is recommended but not mandatory so make this
configurable in case the server does not support it. By default this is
set to true in order to prevent cross-site request forgery.

The state parameter is recommended but not mandatory so make this
configurable in case the server does not support it. By default this is
set to true in order to prevent cross-site request forgery.
balland added a commit to balland/OAuth2 that referenced this pull request Sep 14, 2018
The state parameter is recommended but not mandatory so make this
configurable in case the server does not support it. By default this is
set to true in order to prevent cross-site request forgery.

There is a pending PR in the main repo p2#284
@p2

p2 commented Sep 14, 2018

Copy link
Copy Markdown
Owner

Do you know which servers don't support state? Not using state opens a gaping security hole and I would prefer if it has to be used.

@balland

balland commented Sep 17, 2018

Copy link
Copy Markdown
Author

In my case, this only happens when using QR codes and directly start the authentification process to the step of requesting the redirect URL. So in this case, there is no risk of cross-site request forgery. In the change I did, the state parameter is still checked if there is any.

@p2

p2 commented Sep 17, 2018

Copy link
Copy Markdown
Owner

The risk is in the library being able to be used without state parameter, which I'm not a fan of. How exactly are you starting the flow? Maybe it makes sense to create a subclass for this use case.

@balland

balland commented Oct 2, 2018

Copy link
Copy Markdown
Author

Our scenario is when users log in with QR codes. The QR code encodes directly the redirect url so there is not state to check here. What would be the proper way to add such feature to the library?

@p2

p2 commented Oct 4, 2018

Copy link
Copy Markdown
Owner

Subclass, take a look at e.g. OAuth2CodeGrantNoTokenType.

balland added a commit to balland/OAuth2 that referenced this pull request Sep 22, 2020
The state parameter is recommended but not mandatory so make this
configurable in case the server does not support it. By default this is
set to true in order to prevent cross-site request forgery.

There is a pending PR in the main repo p2#284
ajandrade pushed a commit to sensational/OAuth2 that referenced this pull request Dec 28, 2022
The state parameter is recommended but not mandatory so make this
configurable in case the server does not support it. By default this is
set to true in order to prevent cross-site request forgery.

There is a pending PR in the main repo p2#284
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants