How to get User object from using Access token

ShaileshMoolya
Hi, How to get user info object second time after login. (using C# ) Scenario: First Time starting the app i login normally and store the access Token in DB as it is valid till 24 hr. But in a min or so i encounter a bug in my application and restart my app after fixing it. but i have to relogin ever time again and again while testing and bug fixing as the User Object is readonly and is received only while login. Is there a way or function that returns user object using accesstoken. GetProfile function doesn't return user object.
  • sujith
    You will have to store access token in a shared preference or external file and use that value while initializing object.
    Make sure not to call generate session in every run then your issue will be resolved.
  • ShaileshMoolya
    Yes i do store access token but then when restarted the app which function should i call which returns "User" object.
    Only function i know that returns "User" object is the generate session function.
  • trade_then
    trade_then edited September 2021
    Serialize the whole user object via built in and pass in the
    Dictionary<string, dynamic>
    to User Constructor


    This is to give you general idea about it and is most simplistic. if nothing else is working for you.


    Thanks
    Regards
  • ShaileshMoolya
    thanks for responding.

    i tried this method previously but it was giving errors. but solved it.
    whenever i tried converting it all the list in the user object (eg. bids and offers) were inherently treated as a List. But for User object constructor to work these list should be arraylist. this solved my errors. hope this helps other how are getting this error like me.
Sign In or Register to comment.