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

Getting CORS Error #1

Closed
AasthaSethia opened this issue May 30, 2021 · 5 comments
Closed

Getting CORS Error #1

AasthaSethia opened this issue May 30, 2021 · 5 comments

Comments

@AasthaSethia
Copy link

After integrating with my front end app I am getting CORS issue as my pre-flight request is giving me 403

@sdoxsee
Copy link
Owner

sdoxsee commented May 30, 2021

I'm guessing that's because you need to combine your existing HttpSecurity that handles cors with the one I provided. After adding this one, your old is probably overridden?

@AasthaSethia
Copy link
Author

I did not have any existing httpsecurity I added annotations @crossorigin but that isnt working I added a cors registru bean that isn't working either

@sdoxsee
Copy link
Owner

sdoxsee commented May 30, 2021

Fair enough but I can't really help without more information

@AasthaSethia
Copy link
Author

@OverRide
protected void configure(HttpSecurity http) throws Exception
{
super.configure(http);
http.cors().and().authorizeRequests().antMatchers("/hello").permitAll();
http.csrf().disable();
}
I add this method and it shows cannot have antmatchers after anyRequest

@sdoxsee
Copy link
Owner

sdoxsee commented May 31, 2021

Closing because this is not an issue with the my example code and I haven't been provided with a sample repo to reproduce the error for @AasthaSethia's specific situation. If you you're looking for support, please post on stackoverflow and leave a comment on the blog post (https://sdoxsee.github.io/blog/2021/03/22/multi-tenant-oauth-2.0-resource-servers) where others can assist as well. Regards

@sdoxsee sdoxsee closed this as completed May 31, 2021
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

2 participants