Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dubious "User cancelled the login process" errors #90

Closed
regosen opened this issue Aug 24, 2016 · 17 comments
Closed

Dubious "User cancelled the login process" errors #90

regosen opened this issue Aug 24, 2016 · 17 comments
Labels

Comments

@regosen
Copy link

regosen commented Aug 24, 2016

(Using UberRides 0.5.2 via CocoaPods, tested on iPhone6 with iOS 9.3.4)

Immediately after obtaining a valid access token via deep link, our login methods themselves will sometimes return a nil accessToken with the following error:

com.uber.rides-ios-sdk.ridesAuthenticationError Code=25 "User cancelled the login process."

Note that I definitely did not cancel anything as the user. All I did was press "Allow". This has happened with both of the following methods (with AllTrips request):

(void)loginButton:(UBSDKLoginButton * _Nonnull)button didCompleteLoginWithToken:(UBSDKAccessToken * _Nullable)accessToken error:(NSError * _Nullable)error

[loginManager loginWithRequestedScopes:@[ UBSDKRidesScope.AllTrips ] presentingViewController: self completion: ^(UBSDKAccessToken * _Nullable accessToken, NSError * _Nullable error)

If we ignore the error and use the valid access token we had already received beforehand, everything seems ok.

@jbrophy17
Copy link
Contributor

Hm, looks like a possible race condition when handling the deeplink. I will investigate more

@Avinodh
Copy link

Avinodh commented Apr 10, 2017

Hi I'm facing the exact same issue. After clicking the Uber Login Button in my app, I get redirected to the native Uber app where I click "Allow". I am redirected back to my app. However, I see the following error:
Error Domain=com.uber.rides-ios-sdk.ridesAuthenticationError Code=25 "User cancelled the login process." UserInfo={NSLocalizedDescription=User cancelled the login process.}

Using Swift 3. Would appreciate any help!

@Avinodh
Copy link

Avinodh commented Apr 20, 2017

Following up with respect to the above question @jbrophy17

@runningdemo
Copy link

runningdemo commented Jul 3, 2017

I got the same problem here. Does anyone have any update on this? The Strange thing is I can run the Objective-C demo without this issue.

I am using:

  • UberRides Swift-3-dev branch (0.7.0)
  • In an objective-c code base
  • iOS 10

@edjiang
Copy link
Contributor

edjiang commented Jul 11, 2017

Hey @liaa, @Avinodh, and @regosen:

Just double checking, but did you include the deep link handlers in your AppDelegate? They should look something like this:

@available(iOS 9, *)
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
        
    return RidesAppDelegate.sharedInstance.application(app, openURL: url, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplicationOpenURLOptionsKey.annotation] as AnyObject)
}
    
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
    return RidesAppDelegate.sharedInstance.application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation as AnyObject)
}

@edjiang edjiang closed this as completed Sep 18, 2017
@prgorasiya
Copy link

@edjiang I am also facing this issue and also when I click on Ok from error popup Uber app doesn't redirect to my own app and when I manually open my app console logs the same error message.

But in the backend of Uber it says I authorised my app to use Uber but actually Uber app throws me this error.

Any help?

@edjiang
Copy link
Contributor

edjiang commented Jan 26, 2018

Did you register the URL scheme in your app's info.plist?

@nafetswirth
Copy link

nafetswirth commented Jan 27, 2018

Hey @edjiang,

I'm also seeing this but only for the first time when i press the Uber Login Buttun and the system shows me the alert "x" wants to open "Uber".

After clicking allow and the redirect to my app i get:

Error Domain=com.uber.rides-ios-sdk.ridesAuthenticationError Code=25 "User cancelled the login process." UserInfo={NSLocalizedDescription=User cancelled the login process.}

Second login works fine so that makes me think it's not an issue in the configuration but i might be wrong.

@edjiang edjiang reopened this Jan 29, 2018
@edjiang
Copy link
Contributor

edjiang commented Jan 29, 2018

What iOS version and SDK version are you on, @nafetswirth?

@nafetswirth
Copy link

@edjiang SDK version is 0.8

iOS versions were 9.2, 10.2 and 11.2.1

@edjiang
Copy link
Contributor

edjiang commented Jan 30, 2018

Hey all -- thanks for your patience on this. @lhasiuk has submitted what I believe is a fix to this problem in #222 -- will be verifying and cutting a release shortly :)

@edjiang
Copy link
Contributor

edjiang commented Jan 31, 2018

Fix is published to Cocoapods, 0.8.1. Thanks so much for your help!

@edjiang edjiang closed this as completed Jan 31, 2018
@Avinodh
Copy link

Avinodh commented Feb 5, 2018

@edjiang Been away from this project for a while, but back to working on it. Glad to see a fix for this was just released. Will test this and see if it works in my use case. Thanks for publishing this!

@MEnnabah
Copy link

MEnnabah commented Mar 1, 2018

Hi @edjiang
I am facing the same issue here. The SDK opens Uber native app, it shows "Unable to Connect", and never redirect me back. However, when I manually go back, I see the following NSError:

Error Domain=com.uber.rides-ios-sdk.ridesAuthenticationError Code=25 "User cancelled the login process." UserInfo={NSLocalizedDescription=User cancelled the login process.}

My environment is:

  • Swift 4.2
  • iOS 11.3
  • Physical Device

Podfile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'My-Project' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for My-Project
  pod 'UberRides', '~> 0.9'  
end

AppDelegate.swift:

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        _ = UberAppDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
        return true
    }

    @available(iOS 9, *)
    func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
        let handledUberURL = UberAppDelegate.shared.application(app, open: url, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplicationOpenURLOptionsKey.annotation] as Any)
        
        return handledUberURL
    }
    
    func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
        let handledUberURL = UberAppDelegate.shared.application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
        
        return handledUberURL
    }

info.plist:

	<key>LSApplicationQueriesSchemes</key>
	<array>
		<string>uber</string>
		<string>uberauth</string>
	</array>

	<key>UberClientID</key>
	<string>XXXMYCLIENTIDXXX</string>

	<key>UberDisplayName</key>
	<string>MY-ProjectName</string>

        <key>UberCallbackURIs</key>
	<array>
		<dict>
			<key>UberCallbackURIType</key>
			<string>General</string>
			<key>URIString</key>
			<string>com.bundle.id://oauth/consumer</string>
		</dict>
	</array>

Please let me know if I am missing anything.
Thanks

@MEnnabah
Copy link

MEnnabah commented Mar 1, 2018

^ replying to my comment above, I have successfuly solved it.

I needed to add the following to my info.plist file:

	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>com.bundle.id</string>
			</array>
		</dict>
	</array>

I bieleve this is mentioned in your README.md file, but since I already have those keys in my info.plist file, adding them via plist source code won't affect them. I had to added them to the already-added keys.

@shahidgeek
Copy link

shahidgeek commented Feb 1, 2019

Uber Android Authentication with uber SDK

Solved As Uber latest SKD version 0.10 Android have this "user cancel login" bug

Please following the official link which is based on Uber SDK 0.8 where the latest one has the issue which is 0.10.

Please use sample code from below link which is 0.8 uber sdk, without "login cancel issue". Following sample for android uber sdk is 0.8.

https://github.com/uber/rides-android-sdk

Please change to this one in Manifest file for LoginRedirectReceiverActivity

<activity android:name=".auth.LoginRedirectReceiverActivity"

        android:exported="true">

        <intent-filter>

            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />

            <category android:name="android.intent.category.BROWSABLE" />

            <data android:scheme="com.uber.sdk.android.core.uberauth"

                android:host="redirect" />

        </intent-filter>

    </activity>

Rest is update your code with
client id = your_client_id
server_token = your_server_token
redirect_uri = com.uber.sdk.android.rides.samples.uberauth://redirect

Happy Coding :)

@padsalanilay
Copy link

Hi @edjiang,
I am facing a similar issue. My app gets redirect to the Uber app and right after that it again gets redirected back, and I receive "User canceled the login process" error.
I have added code to AppDelegate and also have added required keys to info.plist
I am using a sandbox and have enabled it in a delegate.

ios - 13.5
cocoa UberRides - 0.13

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants