Use native Google Account Picker with B2C

408

Solution 1

You can create a resource owner password credential (ROPC) flow that enables a native app to collect a user credential and exchange it for an ID token, an access token, and a refresh token with the Azure AD B2C tenant.

These Android and iOS samples demonstrate how you can integrate an Android or iOS app and the ROPC flow using the AppAuth SDKs.

Solution 2

It seems the scenario you are trying might not work with B2C or any other Identity products, You can try the below link to integrate B2C in android with opensource package.

https://azure.microsoft.com/en-in/resources/samples/active-directory-b2c-android-native-appauth/

Share:
408
Chief Wiggum
Author by

Chief Wiggum

Updated on December 12, 2022

Comments

  • Chief Wiggum
    Chief Wiggum over 1 year

    This is more an Azure B2C question than a flutter/android question:

    TLDR: How can I get a B2C JWT token 'eyJhbGciO...' with a Google access token 'ya29.Glss...'?

    We are building an app with flutter that uses Azure B2C to manage the users. While this works fine with simple_auth, we are not huge fans of the whole 'browser popup navigation'/chrome custom tab and we would love to use the native google sign in plugin that shows the local google accounts and allows us to get an access and id token from google (the tokens start with 'ya29.Glss...'. But what are we supposed to do with these two tokens afterwards? I assume I'll have to post it to some custom policy/endpoint somewhere on B2C to receive a B2C token (starting with 'eyJhbGciO...') or do I need to request the token from google with some other parameters?

    Any help would be appreciated. Cheers