Skip to content
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

oauth2: true gets ignored. #124

Open
ciprian-marius opened this issue Feb 20, 2023 · 4 comments
Open

oauth2: true gets ignored. #124

ciprian-marius opened this issue Feb 20, 2023 · 4 comments

Comments

@ciprian-marius
Copy link

behind firewalls i added
api:
pattern: ^/api
security: true
stateless: true
oauth2: true

This basically does nothing. Is there any fix for this? this library is not usable in the current state

@ciprian-marius
Copy link
Author

luckily i asked around on symfony slack channel and some guys were able to help me sort this out. depending on your set up you would need a line on access_control in security.yaml

  • { path: /api/test, role: ROLE_OAUTH2_EMAIL }

Would be nice if the documentation could specify this.

@chalasr
Copy link
Member

chalasr commented Feb 20, 2023

Thanks for sharing your solution.

Would be nice if the documentation could specify this.

I agree. Looks like an easy pick, PR welcome.

@tobias47n9e
Copy link

I hope this helps anyone person looking this up or adding it to the docs.

The pattern in security.yaml as far as I understand is ROLE_OAUTH2_<SCOPE>. So if you have a client with scope user, email or abc then the corresponding access control roles would be: ROLE_OAUTH2_USER, ROLE_OAUTH2_EMAIL, ROLE_OAUTH2_ABC.

@dannn98
Copy link

dannn98 commented Jul 7, 2024

It definitely should be in docs.

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

No branches or pull requests

4 participants