spring-boot-react-oauth2-social-login-demo
spring-boot-react-oauth2-social-login-demo copied to clipboard
Upgraded Spring Boot to 2.4.x
I upgraded the source to Spring Boot 2.4.3. Faced two issues and resolved with few changes.
Problem 1:
java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
Fix:
Added allowPublicKeyRetrieval=true as part of JDBC Url. Ref: https://stackoverflow.com/questions/50379839/connection-java-mysql-public-key-retrieval-is-not-allowed
Problem 2:
java.lang.IllegalArgumentException: When allowCredentials is true, allowedOrigins cannot contain the special value "*" since that cannot be set on the "Access-Control-Allow-Origin" response header. To allow credentials to a set of origins, list them explicitly or consider using "allowedOriginPatterns" instead.
Fix:
This is because Spring Boot after 2.4.0 made changes to the way we configure CORS. Ref: https://stackoverflow.com/questions/65582177/spring-boot-cors-issue