Using iOS SDK, Objective-C (actually wrapper over Swift, so don’t think it matters ObjC or Swift).
Able to authenticate via A0WebAuth, but A0AuthenticationAPI fails with error with same parameters.
Error is: domain: “com.auth0.authentication” - code: 1 “Not Found”
What not found?!?
The only additional parameter for A0AuthenticationAPI is “connection”, I pass value “Username-Password-Authentication” as set in my iOS app in console.
+ (void)startSessionWithAuth0WebAuth {
NSDictionary *auth0 = [Theme apiValueWithName:@"Auth0"];
A0WebAuth *webAuth = [A0WebAuth.alloc initWithClientId:auth0[@"client-id"] url:[NSURL URLWithString:auth0[@"url"]]];
[webAuth addParameters:@{@"audience": auth0[@"audience"]}];
webAuth.scope = auth0[@"scope"];
[webAuth start:^(NSError *error, A0Credentials *credentials) {
if (!!error)
NSLog(@"%@", error);
else {
// WORKS !!!
}
}];
}
+ (void)startSessionWithAuth0AuthorizationAPI {
NSDictionary *auth0 = [Theme apiValueWithName:@"Auth0"];
A0AuthenticationAPI *apiAuth = [A0AuthenticationAPI.alloc initWithClientId:auth0[@"client-id"] url:[NSURL URLWithString:auth0[@"url"]]];
[apiAuth loginWithUsernameOrEmail:<valid_email>
password:<valid_password>
connection:auth0[@"connection"]
scope:auth0[@"scope"]
parameters:@{@"audience": auth0[@"audience"]}
callback:^(NSError *error, A0Credentials *credentials) {
if (!!error)
NSLog(@"%@", error); // <- ALWAYS: domain: "com.auth0.authentication" - code: 1 "Not Found"
else {
// DESN'T WORK
}
}];
}