I have an Azure Function app with Log in with google (I only need google right now) and I cant authenticate correctly
Trial 1 :
- I make a get request to my api : https://examplefunctions.azurewebsites.net/
- Google authentication pop up
- Enter my credentials
- then I make a get request to https://examplefunctions.azurewebsites.net/.auth/me
- I get an json with access_token and id_token and other properties like user_claims etc
- then I go to postman
- make an get request to an function that have AuthorizationLevel.Anonymous : https://examplefunctions.azurewebsites.net/api/myfunction
- Enter the access_token in the autorization with OAuth 2.0
- server return an 401 : You do not have permission to view this directory or page.
- then replace the access_token with the id_token information in the autorization tab in post man and the server return the same.
After that do the following:
Trial 2 :
- go to https://examplefunctions.azurewebsites.net/.auth/login/google in the browser
- Google authentication pop up
- Enter my credentials
- the server redirect to an url that have this property authenticationToken
- I enter this authenticationToken in the OAuth2.0 in postman and return the same 401 : You do not have permission to view this directory or page.
Then I do this and authenticate :
Trial 3 :
- go to https://examplefunctions.azurewebsites.net/.auth/login/google in the browser
- Google authentication pop up
- Enter my credentials
- the server redirect to an url that have this property authenticationToken
- In the headers of post man I put X-ZUMO-AUTH with the value previusly receive in authenticationToken and voila the server response with an OK status with my expected json.
But here the problem in the trial 3 (the only one that works) I dont receive the claims. --> here I get a null var claims = req.HttpContext.User.Claims;
And I need the user google information. Another thing is That I dont want to login using a header like X-ZUMO-AUTH, I want to use the OAuth 2.0 standard.
I dont know why I cant access using the trial 1 and 2, because the server return me an token after i log in, this token seems useless.
I have been trying to make a good google authentication for a week and I cant, I need your help.
NOTE : I will consume this api with an angular, postman, xamarin or maybe flutter

stable_sidand other claims successfully. Perhaps trial 1 and 2 are not supported for function apps. Do check Azure Functions and App Service Authentication for implementing google auth, and samples here AzureFunctionsEasyAuth - Nouman