Coder Social home page Coder Social logo

Comments (8)

vmurin avatar vmurin commented on July 24, 2024

Thank you very much for reporting the issue! I will take care about it and update the library very soon... probable today :)

from react-native-azure-auth.

vmurin avatar vmurin commented on July 24, 2024

Hi,
please try the version 1.3.9 and report what you get. It should either work again or throw another error.

from react-native-azure-auth.

ranshine avatar ranshine commented on July 24, 2024

I tried 1.3.9 i got this error

ExceptionsManager.js:126 Error in silent request:  Error: Invalid id: 
    at normalizeId (baseTokenItem.js:17)
    at Function.createAccessTokenKey (baseTokenItem.js:55)
    at TokenCache.getAccessToken$ (cache.js:83)
    at tryCatch (runtime.js:45)
    at Generator.invoke [as _invoke] (runtime.js:271)
    at Generator.prototype.<computed> [as next] (runtime.js:97)
    at tryCatch (runtime.js:45)
    at invoke (runtime.js:135)
    at runtime.js:170
    at tryCallTwo (core.js:45)

Simulator Screen Shot - iPhone X - 2019-12-02 at 13 28 48

from react-native-azure-auth.

vmurin avatar vmurin commented on July 24, 2024

Perfect! It means you are calling the acquireTokenSilent() with totally wrong userId !
That's the only reason.
It should be String
See the docs

from react-native-azure-auth.

vmurin avatar vmurin commented on July 24, 2024

The normalizeId() function checks the type of the ID
Look here
You see your reported error.

Earlier your problem was the same:

userId.toLowerCase is not a function

i.e. - your userId has another type as string
Try to debug the code.

from react-native-azure-auth.

vmurin avatar vmurin commented on July 24, 2024

Silent token is not working when token got expired. If it is not expired it is working fine

Is it still the case for the lib. v.1.3.9?
I suppose you should have the error with not expired token either.

I tried 1.3.9 i got this error

ExceptionsManager.js:126 Error in silent request: Error: Invalid id:
at normalizeId (baseTokenItem.js:17)
at Function.createAccessTokenKey (baseTokenItem.js:55)
at TokenCache.getAccessToken$ (cache.js:83)

Looks like you got the error with not expired token now. In 1.3.9 I have built in more input validations and now it does not work by you also for not expired token.

Most likely you have an object as userId. Something like this:

{
   userId: 'some id string'
}

The object could be serialized to JSON string and used as key for token cache, that's why it may worked before for not expired token...
Any way double check you input for acquireTokenSilent()

from react-native-azure-auth.

ranshine avatar ranshine commented on July 24, 2024

yes i am passing some wrong userId. You can close the issue
Thanks

from react-native-azure-auth.

vmurin avatar vmurin commented on July 24, 2024

Thank you for your feedback!
And good luck with your app :)

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.