Ionic + angular2-token


#1

Hey everyone,

I’m a Rails developer and I have already an app wrote on ionic 1.

I’m trying to upgrade my app to ionic2 and this app has a devise token base authentication. On ionic1 this worked really fine. But now, on ionic2 I cant find any angular2 token auth based library that works with ionic2.

I’m trying to use the angular2-token lib but i’m facing a bunch of problems with dependencies (the main problem is related with angular/router)

Does any anybody have already implemented this sort of authentication?

Any help, helps.

Best


#2

We use this jwt library that works well:

If you wanted to role your own, it looks simple enough to convert to a devise token system.

Jimmy


#3

Hi,

I’m struggling with this issue right now. I had the same kind of problems with the dependencies, so i downloaded the code and tunned it, manually.

Have a look at https://github.com/neroniaky/angular2-token-example/tree/master/angular2-client/src/app/example

I’ve tested signIn, signOut and validateToken and it works fairly well. Now I’m trying to implement signInOAuth and i’m stucked, mainly because i think that my devise_token_auth configuration for omniauth, in rails backend, is not working properly.

Best regards…


#4

Hey guys,

I’ve just tested the last angular2-token lib version + ionic 3 and it seems that the dependencies problem got solved.

tks everyone


#5

Hey @gustavowt ! I can’t config my project with angular2token, I need your help please,


#6

Hey @briandosejs. I didn’t finish the implementation yet, I’m still working on this during my free times. When its get finished I can write it down here so you guys can even copy/paste it.


#7

hey @briandosejs I just finished the implementation and I just followed the instructions listed on the angulars-token readme https://github.com/neroniaky/angular2-token#requirements

of course I’m using ionic3 which has all dependencies solved.


#8

Great! @gustavowt I’ll try that with Ionic 3!

Regards


#9

Are you still using your modified library? The main branch has a fix for Ionic but it doesn’t seem to work with Ionic 3.9.2. The link above goes to the example app, but not your fixed code.

thx


#10

Hi I’m too in the same condition, but I’m not trying with Omniauth but AuthGurard, Since Ionic dont have Activestate configuration in routes so how should i implement that part or is it not neccessary?