Comments (11)
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?
from sdk-android.
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.
from sdk-android.
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.
from sdk-android.
Hi,
@fabriciovergara you said the SDK "will handle the result" when redirected in redirect URL.
In my app, after login in the browser, I see the access_token (displayed from my redirect_uri), and that's all, nothing else is happening. How do we return to the application with the access_token taken into account ?
Thanks
Rémi
from sdk-android.
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.
from sdk-android.
I used to have https scheme. Now with "app" scheme and my Activity for host, it is working. Thanks.
from sdk-android.
@Olmectron please not use in the scheme the words http or izettle
from sdk-android.
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.
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
2023-01-03 11:42:51.144 25633-25700/com.pospal.pospal I/TokenRepositoryImpl: [{userId=3f329550-70fb-11e5-a847-bda5b59ed83f, tokens=OAuthTokens(accessToken=eytg, refreshToken=IZ89, expirationDate=Tue Jan 03 13:42:50 GMT+05:30 2023, scopes=[READ:PAYMENT, READ:USERINFO, WRITE:PAYMENT])}]
at com.izettle.android.auth.log.StackTraceKt.withStackTrace(SourceFile:1)
at com.izettle.android.auth.TokenRepositoryImpl$applyStoreTokensToTransaction$1.invoke(SourceFile:3)
at com.izettle.android.auth.TokenRepositoryImpl$applyStoreTokensToTransaction$1.invoke(SourceFile:1)
at com.izettle.android.auth.storage.Transaction.commit(SourceFile:27)
at com.izettle.android.auth.tasks.OAuthLoginTask.finalizeTask(SourceFile:10)
at com.izettle.android.auth.tasks.OAuthAuthTask$resume$1.invoke(SourceFile:15)
at com.izettle.android.auth.tasks.OAuthAuthTask$resume$1.invoke(SourceFile:1)
at com.izettle.android.auth.executor.ExecutorImpl.schedule$lambda-3(SourceFile:2)
at com.izettle.android.auth.executor.ExecutorImpl.$r8$lambda$ApSXqycmJTVshYvryZVW9t0bXko(Unknown Source:0)
at com.izettle.android.auth.executor.ExecutorImpl$$ExternalSyntheticLambda0.run(Unknown Source:8)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:334)
at android.os.HandlerThread.run(HandlerThread.java:67)
2023-01-03 11:42:51.216 25633-25633/com.pospal.pospal I/XDR::VRT: sc is not valid!
from sdk-android.
@crashfiredeep Not sure I understand your question correctly. But you don't get the AccessToken
or RefreshToken
in the onActivityResult()
. Instead, you should observe the authentication state. Please see this.
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)
from sdk-android.
@crashfiredeep Not sure I understand your question correctly. But you don't get the
AccessToken
orRefreshToken
in theonActivityResult()
. Instead, you should observe the authentication state. Please see this.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.
from sdk-android.
Hi @crashfiredeep, the SDK doesn't expose the tokens and we have no plan of doing so.
Today there are two ways of authenticating the SDK.
- The SDK handles everything, you just tell it to log in.
- You handle authentication and provide a refresh token that the SDK can use to fetch access tokens when needed. When doing a refund a UI will be triggered to verify the credentials.
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.
We are also working on a third way where the integrator is in full control over the tokens and the SDK will only ask for tokens when needed leaving the integrator in full control. But we don't have a release date for this yet.
from sdk-android.
Related Issues (20)
- 🔒 GitHub Advanced Security has been enabled
- supportsRtl HOT 2
- How to activate Manual Entry? HOT 1
- Can't complete OAuth login flow after upgrading from 1.25.6 to 1.30.1 HOT 1
- Technical error This payment may have not gone through. Please check your receipts and try again # Steps to Reproduce. Popup appearing HOT 3
- Refund appears to be failing
- Action Request(2049, true) is not supported in state ConnectingToRx HOT 4
- Fatal Exception: java.lang.NoSuchMethodError HOT 9
- Feature: Tap to Pay HOT 1
- Incompatible with the most recent React Native version HOT 1
- Really slow processing time HOT 2
- Zettle transaction id tracing
- Fatal error: DatecsReaderV2.onTransactionCompleted HOT 6
- apps keep crashing HOT 2
- development mode HOT 1
- Feature request: URL scheme triggering of card readers HOT 2
- 403 Forbidden upon successful authentication HOT 7
- release-2.11.1 has references to missing com.airbnb.lottie.* classes HOT 5
- SDK not initialized HOT 2
- Please wait... connecting loop... why? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk-android.