简体   繁体   English

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

[英]How to connect Native iOS App <-> Azure B2C?

I am currently trying to connect Azure's B2C with a Native iOS Application. 我目前正在尝试将Azure的B2C与本机iOS应用程序连接。 I have been able to get a Safari popup to return the email/id/response (using AppAuth), but I was looking to actually use an API to complete this while using native iOS elements, not a web page hosted by Microsoft which looks and feels tacky. 我已经能够获得一个Safari弹出窗口来返回电子邮件/标识/响应(使用AppAuth),但是我一直在使用API​​来完成此操作,同时使用本机 iOS元素,而不是由Microsoft托管的外观和外观都不错的网页感到俗气。 Is there a better way to do this? 有一个更好的方法吗?

  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];

At this time your only option is to customize the Azure AD B2C UI . 目前,您唯一的选择是自定义Azure AD B2C UI

Creating your own native UIs requires the resource owner password credentials flow which Azure AD B2C does not yet support. 创建自己的本机UI需要Azure AD B2C尚不支持的资源所有者密码凭据流。 You can vote for this feature ask in the Azure AD B2C feedback forum: Support the resource password credential flow . 您可以在Azure AD B2C反馈论坛中对该功能进行投票: 支持资源密码凭据流

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM