Coder Social home page Coder Social logo

Comments (11)

vmurin avatar vmurin commented on June 25, 2024

The code is truly OK. But I don't see the calls of this methods. Probably you always call getToken before getSilentToken
By the way - the cache is persistent by default.

Did you check the API access with obtained access token? Possibly you do not get the right token at all? Some app registration issues could be the reason.

Are you on android or iOS? I can check only android version and the persistent cache in the sample app works as intended. The AsyncStorage is actually cross platform feature of RN, but theoretically it could have some iOS issues.

Please check all the points above and come back with report :)

from react-native-azure-auth.

skyshine999 avatar skyshine999 commented on June 25, 2024

I am testing in iOS, I am calling getToken then it is showing Microsoft login page and i am getting response like this

accessToken: “XXXXXXXXXXX”

clientId: “XXXXXXXXXXXX”

expireOn: XXXXXXXXXXX

idTokenExpireOn: XXXXXXXXX

rawIdToken: “XXXXXXXXX
”
scope: Scope {scopeStr: “XXXXXXXXX”}

tenantId: “XXXXXXXXXXXXXXXX”

userId: “XXXXXXXXXX”

userName: “XXXXXXXXX”


After that i am killing my app try calling silent token it is again showing microsoft login page and i am doing login then it is navigating to home page.From second time onwards silent token is working fine only first time silent token is navigating to login page.
I am doubting that in async storage token is not storing

from react-native-azure-auth.

vmurin avatar vmurin commented on June 25, 2024

I suppose you encountered some AsyncStorage issue. Are you on the last RN version?

Please check related github issues and solutions proposed there.
For example:
react-native-async-storage/async-storage#158
react-native-async-storage/async-storage#89

Actually you can test AsyncStorage independent from AzureAuth library. Try to instantiate AS and save and retrieve some value.

from react-native-azure-auth.

skyshine999 avatar skyshine999 commented on June 25, 2024

Yes i am using react native latest version
Ok i will check async storage

from react-native-azure-auth.

vmurin avatar vmurin commented on June 25, 2024

You did not listed refresh token in your response. It should be there. The scope offline_access needed to get refresh token is always added automatically. If you did not get it - something goes wrong. Probably you app registration has some restrictions...

from react-native-azure-auth.

skyshine999 avatar skyshine999 commented on June 25, 2024

I debugged Azure auth class, In my response refresh token is there will it cause any problem

from react-native-azure-auth.

vmurin avatar vmurin commented on June 25, 2024

I debugged Azure auth class, In my response refresh token is there will it cause any problem

OK. It should be there, so here is everything right! ;)

from react-native-azure-auth.

skyshine999 avatar skyshine999 commented on June 25, 2024

I checked again async storage is working fine.
1.First time getting response after successful login
2.Killed the app tried silent login then it is asking Yes or no for project then it is navigating to home
3.Killed the app tried silent login, It is working
Second time onwards silent login is working fine

from react-native-azure-auth.

vmurin avatar vmurin commented on June 25, 2024

Hi,

in the issue #46 you wrote

working fine in ios

Does it mean you have now solved this cache issue?
Please update the issue tracker with your solution or found bug.

from react-native-azure-auth.

skyshine999 avatar skyshine999 commented on June 25, 2024

Due to our company policy in azure it is asking again login

from react-native-azure-auth.

elad101 avatar elad101 commented on June 25, 2024

@vmurin when I called acquireTokenSilent, my tokenExpireDate wasn't extended.
Is it related to the App Reg configuration?
In addition, it was mentioned on other Azure auth packages forceRefresh attribute.
Why don't you support that?

from react-native-azure-auth.

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.