MSAL添加范围@“offline_access”,@“openid”,@“profile”问题

时间:2017-11-13 09:41:54

标签: ios objective-c msal

我尝试在下面的代码中添加范围@“offline_access”,@“openid”,@“个人资料”但是显示错误

MSALPublicClientApplication *application = [self createClientApplication];

[application acquireTokenForScopes:@ [@“User.Read”,@“Calendars.Read”,@“Calendars.ReadWrite”,@“Calendars.ReadWrite.Shared”,@“Contacts.ReadWrite”,@“Contacts。 ReadWrite.Shared“,@”Tasks.ReadWrite“,@”Tasks.ReadWrite.Shared“,@”User.Read.All“,@”User.ReadBasic.All“,@”profile“]                        completionBlock:^(MSALResult * result,NSError * error)

显示错误: MSAL 0.1.1-dev iOS Sim 10.3 [2017-11-13 09:39:50 - 496E2A0F-2D99-4171-96A9-D36ABCB08188] MSALErrorInvalidParameter:{(     OpenID的,     轮廓,     “offline_access” 保留范围,可能不在获取令牌调用中指定。 ( - [MSALBaseRequest validateScopeInput:error:]:96)

1 个答案:

答案 0 :(得分:-1)

MSAL会在每个请求中自动包含这3个范围(offline_accessopenidprofile),您无需明确传递它们。