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

Cannot invoke "org.springframework.security.core.Authentication.getName()" because "authentication" is null #80

Closed
parunev opened this issue Aug 5, 2023 · 2 comments

Comments

@parunev
Copy link

parunev commented Aug 5, 2023

While trying to save the User I'm getting this error, I've tried anything from changing my code to be completely like yours...

	at com.docconnect.docconnect.config.oauth2.service.CustomOAuth2UserService.loadUser(CustomOAuth2UserService.java:39) ~[classes/:na]
	at org.springframework.security.oauth2.client.authentication.OAuth2LoginAuthenticationProvider.authenticate(OAuth2LoginAuthenticationProvider.java:117) ~[spring-security-oauth2-client-6.1.2.jar:6.1.2]
	at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:182) ~[spring-security-core-6.1.2.jar:6.1.2]
	at org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter.attemptAuthentication(OAuth2LoginAuthenticationFilter.java:195) ~[spring-security-oauth2-client-6.1.2.jar:6.1.2]
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:231) ~[spring-security-web-6.1.2.jar:6.1.2]
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:221) ~[spring-security-web-6.1.2.jar:6.1.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374) ~[spring-security-web-6.1.2.jar:6.1.2]```
@parunev
Copy link
Author

parunev commented Aug 5, 2023

I want to mention that I'm currently implementing it in the REST API because I don't have access to the front-end, so yeah I want to redirect to URL api/hello-world for now if that might be a problem too

@parunev parunev closed this as completed Aug 5, 2023
@volkaris
Copy link

volkaris commented Jun 1, 2024

how did you fix this?

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