TL DR . Is there an easy way to show a custom Azure B2C registration policy in an ionic application?
I am currently working on a hybrid ionic application that should use the Azure AD B2C API to display a custom login page defined by some third-party developers I work with.
I tried using the ADAL cordova plugin for this, but as far as I can tell, there is no way to add a custom policy for a new web view. I tried adding "p = B2C_1_sign-in-up-policy" as an extraQueryParameters option in the purchaseTokenAsync () call, but this gives me a MethodNotAllowedHttpException .
I'm still not sure what / how ADAL relates to B2C, so I switched to trying to implement Azure B2C Oauth 2.0 . This seems like a mistake, though, because I manually do what the ADAL plugin seems to do.
Is any of them the correct option? Is there an alternative approach to introducing Azure AD B2C for ionic applications?
Thanks in advance
EDIT: . To clarify, my ADAL works to such an extent that the default Microsoft Internet login from ADAL appears, but I would like to show the usual Azure B2C policy instead. Is it possible?
EDIT 2: After using the ADAL AuthenticationContext parameters, calling azquireTokenAsnyc () no longer works in the policy. The parameters look something like this:
var authContextConstants = {
tenant: "[TENANT].onmicrosoft.com",
resourceUrl: "https://login.microsoftonline.com",
redirectUrl: "https://[REPLY_URL]",
clientId: "[AZURE_APP_ID]",
authority: this.resourceUrl + "/" + this.tenant,
extraQueryParams: {
response_mode: "form_post",
scope: "openid offline_access",
p: "B2C_1_[SIGN_IN_POLICY]"
}
};
, webview, , . ADAL ( android), "/oauth2/authorize" "oauth2/v2.0/authorize", B2C Oauth2 Docs
, cordova, - ...