Code Monkey home page Code Monkey logo

Comments (11)

Olmectron avatar Olmectron commented on July 24, 2024 1

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.

fabriciovergara avatar fabriciovergara commented on July 24, 2024

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:

Screenshot 2020-07-13 at 15 29 33

Then in our sample you must fill the iZettleSDK.gradle with this:

Screenshot 2020-07-13 at 15 39 23

Please, let us know if you have any problem.

from sdk-android.

Catzoy avatar Catzoy commented on July 24, 2024

Hi @fabriciovergara

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.

remitettiravou avatar remitettiravou commented on July 24, 2024

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.

fabriciovergara avatar fabriciovergara commented on July 24, 2024

@remitettiravou

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.

remitettiravou avatar remitettiravou commented on July 24, 2024

I used to have https scheme. Now with "app" scheme and my Activity for host, it is working. Thanks.

from sdk-android.

atsneves avatar atsneves commented on July 24, 2024

@Olmectron please not use in the scheme the words http or izettle

from sdk-android.

crashfiredeep avatar crashfiredeep commented on July 24, 2024

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:

Screenshot 2020-07-13 at 15 29 33

Then in our sample you must fill the iZettleSDK.gradle with this:

Screenshot 2020-07-13 at 15 39 23

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.

CheZhongSdk avatar CheZhongSdk commented on July 24, 2024

@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 avatar crashfiredeep commented on July 24, 2024

@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)

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.

bobzettle avatar bobzettle commented on July 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.