如何连接Native iOS App< - > Azure B2C?

时间:2017-06-08 21:16:34

标签: ios azure openid azure-ad-b2c

我目前正在尝试将Azure的B2C与原生iOS应用程序连接起来。我已经能够获得一个Safari弹出窗口来返回电子邮件/ id /响应(使用AppAuth),但我希望在使用 native iOS元素而不是web时实际使用API​​来完成此操作由微软主持的页面,看起来和感觉很俗气。有更好的方法吗?

  NSURL *authorizationEndpoint = [NSURL URLWithString:[NSString stringWithFormat:kEndpoint, kTenantName, kSignupOrSigninPolicy, @"authorize"]];
    NSURL *tokenEndpoint = [NSURL URLWithString:[NSString stringWithFormat:kEndpoint, kTenantName, kSignupOrSigninPolicy, @"token"]];

    OIDServiceConfiguration *configuration = [[OIDServiceConfiguration alloc] initWithAuthorizationEndpoint:authorizationEndpoint tokenEndpoint:tokenEndpoint];

    OIDAuthorizationRequest *request = [[OIDAuthorizationRequest alloc] initWithConfiguration:configuration clientId:kClientId scopes:@[OIDScopeOpenID, OIDScopeProfile] redirectURL:[NSURL URLWithString:kRedirectUri] responseType:OIDResponseTypeCode additionalParameters:nil];

    currentAuthorizationFlow = [OIDAuthState authStateByPresentingAuthorizationRequest:request presentingViewController:presentingVC callback:callback];

1 个答案:

答案 0 :(得分:0)

此时您唯一的选择是customize the Azure AD B2C UI

创建自己的本机UI需要Azure AD B2C尚不支持的资源所有者密码凭据流。您可以在Azure AD B2C反馈论坛中投票赞成此功能:Support the resource password credential flow