Ionic Cloud/Auth Custom Authentication


#1

I have managed to save the user, all it’s information on Ionic Cloud, however the only issue i am facing right now that after i login the user and redirect back to the app the data that was received contains the following information
{“token”:“eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjNWQ3MWFiMy1iNzYzLTQ5MGYtYjE2Ni04MjBiZWI4Zjc0Y2UifQ.TGi3weJcZKzfXXIAIojJAysrJTYSFlt2PWxshLxT2fc”,“signup”:false}

however this jwt token does not have any useful information so we can verify who is the user on the backend server, any idea ?

Thanks


#2

From which step is this jwt token you are talking about?
https://docs.ionic.io/services/auth/custom-auth.html

Can this help?
https://docs.ionic.io/services/auth/custom-auth.html#user-data


#3

@Sujan12 This JWT is coming from Ionic server as the below scenario

1- Login (Custom)
2- Ionic redirect to our endpoint
3- Our backend verify the token and authenticate the user
4- Our backend generate JWT signed with user_id and other properties added to Custom Data
5- User has been created or updated on ionic server successfully
6- Ionic server redirect back to the app with the following information
{“token”:“eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjNWQ3MWFiMy1iNzYzLTQ5MGYtYjE2Ni04MjBiZWI4Zjc0Y2UifQ.TGi3weJcZKzfXXIAIojJAysrJTYSFlt2PWxshLxT2fc”,“signup”:false}
7- I use this token to validate the user on each request on our backend but it’s useless since it does not contain any useful claims.


#4

Isn’t the stuff you added available via https://docs.ionic.io/services/auth/#user-details?
Or do you want to revalidate the last token again?


#5

@Sujan12 i want to revalidate the last token sent from ionic server, as by this way we make sure each request is validated but the jwt it self does not contain any userful information.


#6

Ok. Best chance for Ionic Services releated questions is probably using Ionic’s Zendesk for Ionic Services linked at http://ionicframework.com/support.

Please let us know if you get this answered.


#7

Sure,i will post the solution if i got it, Thanks


#8

an update, ionic team responded that i am not a priority to check this issue unless i am an enterprise user they will investigate, however i have changed the whole authentication approach by not using their service,

Thanks


#9

Hi abomadi, did you ever get a response to this from Ionic support?