0
votes

I am using below method of ADAL iOS library to Acquire access token silently.

acquireTokenSilentWithResource:completionHandler:

But it fails with an error:

ERROR: Error raised: 10. Additional Information: Domain: ADAuthenticationErrorDomain ProtocolCode:(null) Details:The user credentials are need to obtain access token. Please call the non-silent acquireTokenWithResource methods.. ErrorCode: 10.

Any help is appreciated.Tested in both ADAL iOS versions 1.2.1 and 1.2.9.

1
Can you provide more details about your scenario? Has the user already authenticated once before (so that acquire...Silent can use the refresh token to get a new access token silently)? - Philippe Signoret
yes in my case user already authenticated manually using username and password.But after each 1 hour the access token is getting expired.So I am calling above acquireTokenSilent... method to get new access token. - Shyam
Can you share the code you're using for: "manually using username and password"? - Philippe Signoret
@Shyam did you solved this? am having same problem - Himanth

1 Answers

1
votes

In order for this method to succeed, there must first be a successful token acquisition. First use: acquireTokenWithResource, the user will be presented with UI for credentials. ADAL will cache the tokens. The subsequent call to acquireTokenSilentWithResource will then succeed (assuming the resource etc. are the same).