Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

SSO Authenticate to Microsoft.Graph and an Azure App Service

swillettswillett Member ✭✭

Hi,

I want to be able to access microsoft.graph and and azure app service from xamarin forms. I can follow tutorials on how to do each one individually, but lost how to do SSO with both.

Authenticate to an azure app service: docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-xamarin-forms-get-started-users

Authenticate to Microsoft Graph: docs.microsoft.com/en-us/graph/tutorials/xamarin

I know graph has the ability to expose an api which is what I may be looking for: docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-configure-app-expose-web-apis

If anyone is able to provide code samples, walk me through, or help me fill in gaps with what I am trying to do I will be very grateful.

Thanks for your time.

Best Answer

  • swillettswillett Member ✭✭
    Accepted Answer

    Think the trick is the Microsoft Identity Platform: docs.microsoft.com/en-us/azure/active-directory/develop/

    I can authenticate to graph using the tutorial for graph I mentioned, which authenticates with the Microsoft Identity Platform: docs.microsoft.com/en-us/graph/tutorials/xamarin

    That exposes a token, which allows me to implement my own authentication from my web api in my azure app service (or elsewhere) to the Microsoft Identity Platform, rather than using Azure Active Directory Authentication feature in the azure app service. I can do this likely following something like this: docs.microsoft.com/en-us/azure/active-directory/develop/scenario-protected-web-api-overview

    So implementing the authentication / authorization in the web app itself, rather than through the app service may be key.

Answers

  • swillettswillett Member ✭✭
    Accepted Answer

    Think the trick is the Microsoft Identity Platform: docs.microsoft.com/en-us/azure/active-directory/develop/

    I can authenticate to graph using the tutorial for graph I mentioned, which authenticates with the Microsoft Identity Platform: docs.microsoft.com/en-us/graph/tutorials/xamarin

    That exposes a token, which allows me to implement my own authentication from my web api in my azure app service (or elsewhere) to the Microsoft Identity Platform, rather than using Azure Active Directory Authentication feature in the azure app service. I can do this likely following something like this: docs.microsoft.com/en-us/azure/active-directory/develop/scenario-protected-web-api-overview

    So implementing the authentication / authorization in the web app itself, rather than through the app service may be key.

  • ColeXColeX Member, Xamarin Team Xamurai

    Hi , @swillett If you got the solution , please mark it as answer .

  • swillettswillett Member ✭✭

    Yep, think this explains the system: docs.microsoft.com/en-us/azure/active-directory/develop/authentication-scenarios

Sign In or Register to comment.