Questions about helper library for working with JWTs in your Angular 2 applications
Questions tagged [angular2-jwt]
97 questions
0
votes
1 answer
Trying to use tokenNotExpired from angular2-jwt but getting error in modules
I am trying to use tokenNotExpired of angular2-jwt for check if user is logged in or not. But when i implement this I get below error in cli:-
ERROR in node_modules/angular2-jwt/angular2-jwt.d.ts(3,10): error TS2305: Module '"d:/Visual…

Yashdeep Raj
- 1,006
- 10
- 22
0
votes
1 answer
angula2-jwt AuthHttp issue
am using angular v6 when i try to use AuthHttp from angular2-jwt in my service constructor the page wont do any request or render.
I have added AUTH_PROVIDERS to the providers, but I have no error at the same time.
import { AuthHttp } from…

MuhanadY
- 752
- 1
- 12
- 40
0
votes
1 answer
How to create a JWT token using angular 2 typescript
IN Component
import * as jwt from 'jsonwebtoken';
var maykey = privatekey;
var token = jwt.sign({ foo: 'bar' }, maykey, { algorithm: 'RS256' });
I am getting below error.
Uncaught (in promise): TypeError: crypto.createSign is not a…

Abhijit.P
- 39
- 1
- 4
0
votes
1 answer
Required MultipartFile parameter 'file' is not present when I request from Angular 4
I can do a request uploading a file from Postman, but when I do the request from Angular, it is returned the WARN "Required MultipartFile parameter 'file' is not present"
It follows my resource in API.
@PostMapping
public ResponseEntity…

Igor Ramos
- 251
- 1
- 2
- 8
0
votes
1 answer
angular2-jwt token is not working, LoggedIn function not working
I am making a simple mean auth app, where angular2-jwt is used to authenticate the user logging in, right now, i want that before logging in, i dont want Dashboard, Profile to be shown on navbar, whereas after login, Register and Login should be…

Jibran Yousuf
- 77
- 1
- 10
0
votes
1 answer
Set Jwt Token in Local Storage - Angular
I'm using auth0/angular-jwt library on branch v1.0 which supports HttpInterceptor.
Here is my app.module.ts:
imports: [
BrowserModule,
HttpClientModule,
HttpModule,
JwtModule.forRoot({
config: {
authScheme: 'Bearer',
…

mskuratowski
- 4,014
- 15
- 58
- 109
0
votes
1 answer
After Login success wont redirect to main page and Authguard said login failed MEAN 2
So here I have an MEAN 2 auth app when I tried to login it said that login success but it wont navigate to main page and said that please login first from the authguard
This is My Login component html

user3567523
- 59
- 7
0
votes
1 answer
Angular 5 mixed auth types with legacy system
We've got a legacy system which we want to bring over to Angular. Since the system is big we will go step by step and bring over module by module.
Now until we're done with the whole System we will likely need to switch between the Angular SPA and…

hogan
- 1,434
- 1
- 15
- 32
0
votes
1 answer
How to debug JWT Bearer Error "invalid_token"
I'm trying to secure an existing AspNet Core 2.0 / angular 4 app using jwt. I'm using angular2-jwt for the client part and it works just fine. However when it comes to my WebApi, my token is always rejected(using AuthHttp from angular2-jwt to launch…

Maxime Laflamme
- 3,786
- 2
- 11
- 12
0
votes
2 answers
angular2-jwt: AuthHttp causes an error 'Expected 0 type arguments, but got 1.'
when I use AuthHttp from angular2-jwt in code below, I see error:
"Expected 0 type arguments, but got 1."
public getData(): Observable{
const url = environment.apiUrl + "users";
return this.authHttp
.get(url)
.map((res: User[])…

pelcomppl
- 575
- 2
- 6
- 16
0
votes
1 answer
Token expired or deleted show login pop up in angular 4
I am application used token based authentication using JwtHelper, by canActivate method validating the router change and redirecting to the login page.
But the page is not redirecting to login page after token expired or deleting the local…

Govinda raj
- 613
- 3
- 16
- 31
0
votes
1 answer
Angular CLI + Angular2-JWT Error
I used Angular CLI to generate an app.
Ran "npm install angular2-jwt" in the terminal
Added the script reference to angular-cli.json:
"scripts":[
...
"../node_modules/angular2-jwt/angular2-jwt.js"
...
]
Ran "ng serve" No problems…

The One
- 4,560
- 5
- 36
- 52
0
votes
0 answers
Proper way to check if user is authorized on the backend (laravel 5.4 & tymon-jwt)
I'm using Angular 4 and Laravel 5.4 & Tymon JWT. Currently I just pass the token from the frontend which is stored in local storage to the backend and Tymons default auth does its work. However I have some columns in my database like canView,…

derrickrozay
- 1,048
- 3
- 15
- 37
0
votes
1 answer
AuthHttp doesn't send post payload
I was using angular 4's default Http module to send http request without any problem. However, I recently replaced the Http module with AuthHttp from angular2-jwt package. Now with AuthHttp, it stopped sending body as payload to the server in post…
user1663023
0
votes
1 answer
Where to set AuthConfigConsts for the angular2-jwt?
I'm using angular2-jwt for authentication. I need to change the default token name from token to customer.
I know I need to change DEFAULT_TOKEN_NAME property in AuthConfigConsts. But I'm not sure where and how should I do it.

Viv
- 913
- 1
- 7
- 18