Questions tagged access-token

Explore the latest questions and answers asked by our top developers.

Does refresh token requires Expired JWT for creating new access token?

In my recent encounter, I was trying to implement JWT Tokens storing securely in the Front-End. What my previous approach is to store access_token as well refresh_token in sessionStorage which is vulnerable to XSS attacks. Now, when access_token expires, I’ll call for /refresh endpoint to obtain a new access_token. Here I’m passing expired JWT into […]

Silent renew doesnt update token after calling Authorize endpoint

The silent_renew logs out the user after a call to the connect/authorize endpoint. I have silent_renew.html that is invoked after a call to https://localhost:6001/connect/authorize, but after that no more calls are made or shown on the network tab. And the identity server is responding to the authorize request without any error logs. I have an […]

Subscribe not executing after getting fresh access-token in Angular 10

I have used access-token and refresh-token mechanism for authentication in API. when my access-token gets expired I am getting 401 Unauthorized error in APIs. so I am calling request which returns fresh access-token using refresh-token which is working correctly. but issue is what ever code written inside .subscribe function is not getting re-executed. getActivePlan() { […]

Amadeus API angular token generation

I am trying to get token for using amadeus services, which uses a client secret and a client key. I am implementing it through angular which i am very new at. Please suggest me some help urls or ways to implement it. here is what i have done till now. import { Component, Input, OnInit […]

By Amit Pandey
Published
Categorized as access-token, amadeus, angular, api Tagged , , ,

Get access token

In my app I want to take access token for authorization purpose. When user log in to the system it generate tokens as below. "tokens": "{‘refresh’: ‘eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTYxMzcwMzg2OSwianRpIjoiZmQ1MjU5ODVmNjMwNGI1NWFiNjJiNGVmYmNhMGUyNTMiLCJlbWFpbCI6InRlc3RAZ21haWwuY29tIn0.OAR-aUstvgPz8Yue7Zo8OFQyjvwCFK8_a5n84cPqLCs’, ‘access’: ‘eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjEyNjY3MDY5LCJqdGkiOiJlMGZkZmUyNWI0OWI0ZDdmODJkYWE4YTJhZWUwYjdmZCIsImVtYWlsIjoidGVzdEBnbWFpbC5jb20ifQ.TKw15NmLbSdIRwXWiu6UiMIudaCe5ecqyANNvA7YLQg’}" It has both access and refresh tokens. But I just need access token for authorization purpose. How can I take just access token. Source: Angular Questions

By Lanka de silva
Published
Categorized as access-token, angular, api Tagged , ,

When I set observe: response in the http options, the .subscribe returns an undefined access_token. How to fix it? [closed]

These are the options set in the authentication service. httpOptions2 = { headers: new HttpHeaders({ ‘Content-Type’: ‘application/json’, ‘Access-Control-Allow-Origin’: ‘*’, ‘Authorization’: ‘Bearer ‘+localStorage.getItem("access_token") }), observe : ‘response’ as ‘response’}; However, the access_token always return undefined. If I remove the observe: response, it works fine. I need to use observe: response. this.http.post(environment.getBaseAddress() +url+’/’, data, this.httpOptions2).subscribe((data) => { […]

By Alexander E Alvarado
Published
Categorized as access-token, angular, http, options Tagged , , ,

angular2 Oauth2.0 handle token and update history

I’m trying to implement OAuth2.0 authentication using angular. After a successful authentication, i get redirected to the redirect_uri in my angular application and i check for the token which comes in the URL as a queryParam in NgOnInit : this.activatedRoute.queryParams.subscribe( params => { if (params[‘token’]) { localStorage.setItem… // storing token this.location.replaceState(‘home’) … }); Two things […]

Microsoft graph – Access token validation failure. Invalid audience – Error

I am trying to send mail using Graph API from Angular app. In Azure active directory i have given the API permission for Mail.Send and other mail related things. below is the code const resource = { grant_type : ‘client_credentials’, clientID: ‘****************************’, redirectUri: ‘http://localhost:4200/’, validateAuthority : true, popUp: true, scopes: [‘mail.send’], resource : ‘https://graph.microsoft.com’ }; […]

Angular HttpInterceptor RangeError: Maximum call stack size exceeded

I have a problem with my HttpInterceptor calling many times in a short period that it results in an error: RangeError: Maximum call stack size exceeded. My HttpInterceptor is intercepting every request to add a bearer token to the header. The first time it passes the intercepter it will get the token from the authentication […]

How to authentication against Web Api in an angular application without login

I have an Angular Application and a Web Api. When any user access to the app, he is route to login page and using the user’s credentials I create a token (with JWT), with which the application authenticates to consume the api. However, login is not mandatory any more, users can access to home page […]

By IranSosa
Published
Categorized as access-token, angular, jwt, webapi Tagged , , ,
1 2

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq