Which of the Azure Active Directory authentication flows would I use for a single-tenant web application that needs to call the Microsoft Graph API and is launched from the Office 365 app launcher?
Office 365 is using the same tenant as the web app, and I'm using the Azure AD v1 endpoint. The example I tried does not quite work for this scenario, because it expects the user to not be signed-in already.
I tried this example: https://github.com/microsoftgraph/aspnetcore-connect-sample
It works correctly when going to the application directly, but clicking its icon in the Office 365 App Launcher immediately displays the following error:
Exception: OpenIdConnectAuthenticationHandler: message.State is null or empty.
Is the solution to sign the user out and re-authenticate them in order to get an authorization code to cache, or should I use the "on behalf of" flow instead?