YannickRe / ms-graph-proxy-function

Azure Function that acts as a Proxy to the Microsoft Graph, for the purpose of allowing Power BI to connect to the Microsoft Graph
20 stars 10 forks source link

Issue with getting auth header #3

Closed MCKRUZ closed 4 years ago

MCKRUZ commented 4 years ago

Good afternoon,

I have setup this project and it looks like there is currently an issue with the following piece of code

req.GetTypedHeaders().Get<AuthenticationHeaderValue>("Authorization").Parameter);

It looks like it can't find that particular parameter in the header. Any thoughts?

this is in the internal static IAuthenticationProvider GetAuthenticationProvider(HttpRequest req, Config cnfg) method

MCKRUZ commented 4 years ago

So I got a little further, essentially when I tried this is postman and I added a bearer token I got this to populate, but the issue is actually bigger then that. The problem is that if I go the route of setting applicationPermissions to false, even when I login with PowerBI and put my Azure account in I get the same "is null" exception. Which makes me think that PowerBI isn't adding on my credentials.

Have you been able to get this to run successfully with ApplicationPermisssions set to false?

MCKRUZ commented 4 years ago

I also looked at this section of the readme

Copy the existing url Add it again, without '/.auth/login/aad/callback' (make sure there is no more ending /)

The only url in the Allowed Token Audiences is the

https://{name of my function app}.azurewebsites.net

is that correct? I don't see one that has the ending that you state in the instructions.

YannickRe commented 4 years ago

@MCKRUZ I hope you figured it out, and I'm sorry I wasn't able to respond sooner! Mind telling me what was the problem?

MCKRUZ commented 4 years ago

You know I wish I knew. I ended up just starting over and doing it all again and it worked this time! lol I hate that.

YannickRe commented 4 years ago

Ha, I agree! Just happy it worked out for you in the end, have fun!