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
How to add user login? #7
Comments
Hi @Catzoy Sorry for the lack if details, there is still a work in progress regarding the integration process and documentation. In the https://developer.izettle.com/ after you create a Payments Android SDK credential you will be prompted to add the redirect URI. In the app, after user finish an authentication (which happen in a browser) we still redirect to this URI and the sdk will handle the result. We suggest to not use https since it's really specific for iZettle login for your app and we would like to not have deep link conflict with other apps, in the same way when you share a photo and you are prompted to choose which app will handle it. If you choose this redirect URI: Then in our sample you must fill the iZettleSDK.gradle with this: Please, let us know if you have any problem. |
Thank you for quick response! Issue was that we didn't add any OAuth Redirect URI in the https://developer.izettle.com/ for our app and that's why SDK always returned "redirect_url contains not allowed URI" for anything we tried. Closing issue as resolved. |
Hi, @fabriciovergara you said the SDK "will handle the result" when redirected in redirect URL. Thanks Rémi |
After the login, the browser will be redirect to the deep-link registered in your app manifest: <activity
android:name="com.izettle.android.auth.OAuthActivity"
android:launchMode="singleTask"
android:taskAffinity="@string/oauth_activity_task_affinity">
<intent-filter>
<!-- Deep link data -->
<data
android:host="izettlelogin"
android:scheme="izettlesample />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity> Please, check if the values are correct and the same as declared in the developer portal. |
I used to have https scheme. Now with "app" scheme and my Activity for host, it is working. Thanks. |
I'm getting the message: Invalid protocol, can not start with "izettle" or be one of http:// or file://. When trying to put izettlesample://izettlelogin in the OAuth Redirect URIs list. Has the correct redirect URI changed by now? |
@Olmectron please not use in the scheme the words http or izettle |
I have also followed same and login is working redirecting to app but never able to see access token and refresh token in onActivityResult(). but what about access token as mentioned in documentation?? But i can see the log like |
@crashfiredeep Not sure I understand your question correctly. But you don't get the Here is the example code in Example project. (https://github.com/iZettle/sdk-android/blob/master/Examples/Example-Kotlin/app/src/main/java/com/izettle/payments/android/kotlin_example/MainActivity.kt#L33) |
that is already implemented but if logged in states of login is also coming false, and what if I need to access payment flow using token. in these methods there is no way to get token and refresh token. My app is need to login every time for payment, so I want to store the token and process further based on this token, so that user only need to login once. |
Hi @crashfiredeep, the SDK doesn't expose the tokens and we have no plan of doing so.
Both of the above methods will keep the user logged in as long as the tokens are valid. So if you don't explicitly log out the user you should not be prompted to log in on every payment. The tokens are valid for quite some time. As a side note. |
In step 2 of "Getting Started" our app must add a callback activity for user OAuth login with some "redirect URL", yet it is unclear what redirect URL must do and who provides such URL.
Please explain how to add user authorization to the app.
The text was updated successfully, but these errors were encountered: