Hi i am new for oauth2 spesification and i try login with google provider. i have gateway and backend service in my project. Gateway is a oauth2 client, Backend servise is a oauth2 resource server.

i create a token with oauth2 client in my api gateway and i request my backend service by this token but response is always 401

Spring Security Spring Oauth2 Resource Server Invalid Bearer Token Exception

my configuration is true and i am able to validate google openApi url but my backend servise is not able to validate my token. openApiurl -> https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=accessToken

it is example token = Bearer ya29.a0Aa4xrXNR2aR78a9Qkq-cTQvB8GsRdMiy4MjZnXXqK3HrCRBEBby_-tnekMxr2VP5Stw67oKcPsby14MK3Ppfi5nCN0lbzWkxX3z-DhZsCAtwGX24JKkryHudFo_Mk7OGKwwVy127fp1zlWXzW3sLvJlSmMl-aCgYKATASARMSFQEjDvL9KbonzV4tPnjEB3TVBPe3sg0163

Project's url https://github.com/abidino-events/api-gateway --> gateway https://github.com/abidino-events/mail-service --> backend service

My sources are https://docs.spring.io/spring-security/reference/servlet/oauth2/resource-server/jwt.html, https://www.baeldung.com/spring-cloud-gateway-oauth2

Comment From: marcusdacoregio

Hello @abidino, thanks for getting in touch. It feels like this is a question that would be better suited to Stack Overflow. As mentioned in Getting Support, questions should be submitted to StackOverflow. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.

Comment From: abidino

thank u for answer, i could not find anythink about this subject so i used keycloak and solved problem :))