angular2-jwt

Implicit grant SPA with identity server4 concurrent login

瘦欲@ 提交于 2020-01-11 07:48:06
问题 how to restrict x amount of login on each client app in specific the SPA client with grant type - implicit This is out of scope within Identity server Solutions tried - Access tokens persisted to DB, however this approach the client kept updating the access token without coming to code because the client browser request is coming with a valid token though its expired the silent authentication is renewing the token by issues a new reference token ( that can be seen in the table persistGrants

angular 2 refresh token before custom http request

百般思念 提交于 2019-12-24 07:01:05
问题 I want to refresh the token before the custom http request if it is expired. I try my code when I'm sure that the token is expired but it gives the following console result: Token refresh is required app.js:1:92855 updateToken() method inside app.js:1:93301 tokenNotExpired?: false app.js:1:92674 Token refresh is required app.js:1:92855 updateToken() method inside app.js:1:93301 tokenNotExpired?: false app.js:1:92674 Token refresh is required app.js:1:92855 updateToken() method inside app.js:1

Angular2 - How to best handle expired authentication token?

人走茶凉 提交于 2019-12-20 11:59:23
问题 I am using Angular 2.1.2. I have an authentication token (using angular2-jwt) and if it expires my webApi call fails with a 401 error. I am looking for a solution where the user will not lose any input data. I can catch this 401 and open a modal with the login. The user then logs in, the modal goes away, and they see their input screen. However, the failed requests are showing errors so I need to reprocess the requests. If it was a router navigate the initial data has not loaded. I could

How to send JWT token as authorization header in angular 6

假如想象 提交于 2019-12-20 10:47:07
问题 Currently I used this static code in component .ts file but this one is not work. It returns unauthorized(401). But when I pass token as query string it works fine. Please give a working example for component .ts file. import { HttpClient, HttpResponse ,HttpHeaders} from '@angular/common/http'; var t=`eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9

No provider for AuthHttp! on angular2-jwt

爱⌒轻易说出口 提交于 2019-12-10 22:08:55
问题 im really new on Angular 2 and i want to use JWT on my project. So i follow the instructions exactly where a give from the official page of angular2-jwt using the basic configuration. I create a file named auth.module.ts with the following code: import { NgModule } from '@angular/core'; import { Http, RequestOptions } from '@angular/http'; import { AuthHttp, AuthConfig } from 'angular2-jwt'; function authHttpServiceFactory(http: Http, options: RequestOptions) { return new AuthHttp(new

Angular - JWT Refresh Token

你。 提交于 2019-12-10 10:19:28
问题 After a long time I didn't find an approach about refresing tokens TTL: 30 minutes Refresh TTL: 2 Weeks If I refresh the page after 45 minutes innactive then I make a getAccessToken() function to send the expired token and then send me back a refreshed token. The big problem is that if my page makes more than 1 ajax request then if the first request invalidate my token the second request force my to relogin becauce it send empty token @NgModule({ providers: [ { provide: AuthHttp, useFactory:

Angular2 Spring Boot JWT missing Response Header

吃可爱长大的小学妹 提交于 2019-12-08 08:16:49
问题 I use Angular2, Angular-cli, Spring Boot 1.4.0 and jwt. When I sign in my Angular2 client I can not get jwt token. My security config is: @Configuration @Order(SecurityProperties.ACCESS_OVERRIDE_ORDER) public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable() // disable csrf for our requests. .authorizeRequests() .antMatchers("/").permitAll() .antMatchers("/api/user/signup").permitAll()

Angular2 Spring Boot JWT missing Response Header

只谈情不闲聊 提交于 2019-12-06 20:37:27
I use Angular2, Angular-cli, Spring Boot 1.4.0 and jwt. When I sign in my Angular2 client I can not get jwt token. My security config is: @Configuration @Order(SecurityProperties.ACCESS_OVERRIDE_ORDER) public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable() // disable csrf for our requests. .authorizeRequests() .antMatchers("/").permitAll() .antMatchers("/api/user/signup").permitAll() .antMatchers(HttpMethod.POST, "/api/user/login").permitAll() .anyRequest().authenticated() .and() // We

Angular 6 using angular2-jwt

不想你离开。 提交于 2019-12-06 04:10:38
问题 After the migration of my app from Angular 4^ to Angular 6 (newest version) I got a very weird error in my Auth service. Specific, the angular2-jwt package is causing a killer error when I try to "serve" or "build" the app in production environment. In the other hand, the same code runs perfectly well on "dev" environment. OS -> MacOS 10.13.6 The error I got when execute ng serve --configuration production : ERROR in : Error: Internal error: unknown identifier [{"filePath":"/Users/paulo

Angular 6 using angular2-jwt

我们两清 提交于 2019-12-04 11:09:17
After the migration of my app from Angular 4^ to Angular 6 (newest version) I got a very weird error in my Auth service. Specific, the angular2-jwt package is causing a killer error when I try to "serve" or "build" the app in production environment. In the other hand, the same code runs perfectly well on "dev" environment. OS -> MacOS 10.13.6 The error I got when execute ng serve --configuration production : ERROR in : Error: Internal error: unknown identifier [{"filePath":"/Users/paulo/Projects/eleo-usuario/node_modules/angular2-jwt/angular2-jwt.d.ts","name":"AuthHttp","members":[]},{