Auth0 Home Blog Docs

iOS Objective-C Auth0 Login Implementation

Hi,

i am iOS Developer, working on Objective-C Language,

i have been working on iOS App, this XCode Project contain 5 Targets, i’m trying to installing Auth0 Login API to one of Target into my iOS application but there are several issues appearing i.e “No such module ‘Auth0’” . how to resolve it.

Hey there @subscription!

There’s definitely something wrong going with your setup but let me help you!

  • Firstly we don’t have a Login API as you mentioned

I would like you to provide me with more context for example:

  • What tutorial / quickstart / docs you use (link)?
  • What SDK you want to implement ?

Let’s start with that! Thank you!

i’m using WEB Login, Installing into my iOS app by using Cocoa Pods but

  1. After Integrate Auth0 into our app then onwards app running slowly , It is taking 2 to 3 mins time to to run & see the output every time in my system , before installation it was taken 5 to 8 seconds time.

i have used “HybridAuth.swift” to get Web Login but getting compile error: “Auth0 Framework not found”.

how can i fix this compile error ?

Can you share here any link url you use to implement? We don’t have any SDK that is called Web Login that’s why I’m keeping asking you questions. Any screenshot would be also useful. Thank you!

Hey there!

Have you had a chance to see my previous reply?

Hi
i’m using XCode: 11.0 & iOS 12+.

  1. By using above link i have downloaded Objective-C Code

  2. I have added my Domain ID & Client ID and run the app , it is working as expected (it is returning token ) in your sample code.

  3. by using that token calling “userinfo” web services then it is returning all user details correctly in your sample code.

  4. After integrate same code into my Project by using CocoaPods , there is no issues , integrated successfully

  5. i’m using webLogin (it is taking iOS Safari browser to return “Login Page”)

  6. i set Callback & Logout url as:

PRODUCT_BUNDLE_IDENTIFIER}://YOUR_DOMAIN/ios/{PRODUCT_BUNDLE_IDENTIFIER}/callback

  1. by using “HybridAuth.swift” i’m calling below code into my Project (Objective-C )
 HybridAuth *auth = [[HybridAuth alloc] init];
[auth showLoginWithScope:@"openid profile"
                          connection:nil callback:^(NSError * _Nullable error,
                                                    A0Credentials * _Nullable credentials)
             {
                              dispatch_async(dispatch_get_main_queue(), ^{
                                  if (error)
                                  {
                                      //NSLog(@"Error: %@", error);
                                  }
                                  else if (credentials)
                                  {
                                      [self showAlertWithMessage:[NSString stringWithFormat:@"Success, Access Token: %@", [credentials accessToken]]];
                                  }
                              });
                          }]

  1. in Auth0 Web Login Page, After enter username & password - Click on login button then appearing one issue is: “SAFARI CAN NOT OPEN THE PAGE BECAUSE THE ADDRESS IS INVALID“ (it is working in your code, why not working in my project ?)

  2. Some time before loading the Login page then also showing “SAFARI CAN NOT OPEN THE PAGE BECAUSE THE ADDRESS IS INVALID“ .

Could you please suggest me how to resolve this issue in my code.

Yep sure! Let me troubleshoot that, try to reproduce and get back to you shortly! Thanks a lot for providing all those details.

I have used: pod ‘Auth0’, ‘~> 1.19’ . version to install into my project by CocoaPods.
Could you please tell how to fix this issue in my project because i got stuck with this issue.