Azure AD B2Cで認証されたXamarinフォームで開発されたAzure Mobile Servicesの例をお探しください。私はXamarin FormsでAzure B2Cを使用して認証でき、Azure Mobile Servicesで結果のトークンを使用することができない実用的なソリューションを持っています。以下のコードスニペットをご覧ください:Azure AD B2C AzureモバイルサービスXamrinフォームの例
public static PublicClientApplication AuthenticationClient { get; private set; }
public static MobileServiceClient MobileService = new MobileServiceClient(Constants.MobileServiceClientName);
result = App.AuthenticationClient.AcquireTokenAsync(
Constants.Scopes,
string.Empty,
UIBehavior.SelectAccount,
string.Empty,
null,
Constants.Authority, null);
JObject objToken = new JObject();
objToken.Add("authenticationToken", result.IdToken);
//I am successfully able to get an Id token for Microsoft, Google and Twitter providers but when I use the token to login to my Azure Mobile Service app, I get a "Not Authorized" error
MobileServiceUser user = await MobileService.LoginAsync(MobileServiceAuthenticationProvider.MicrosoftAccount, objToken);
すべてのアイデアは高く評価されています。
上記のコードの変更を参照してください。 – sidsud
上記のコードを変更してください:objToken.Add( "authenticationToken"、result.IdToken);がobjToken.Add( "access_token"、result.IdToken)に変更され、MobileServiceAuthenticationProvider.MicrosoftAccountがMobileServiceAuthenticationProvider.WindowsAzzureActiveDirectoryに変更されました。 – sidsud