0

I have multiple API's using IISDefaults.AuthenticationScheme, which my angular site call. The problem is each time the user navigates to a component that accesses a different api they need to log-in again.

To make this more elegant what is the better approach? I'm thinking I should have a user API which uses windows authentication and returns a JWT and the user group the user is assigned to? Then the angular passes these parameters to the API's which query the db.

Any ideas/suggestions/blogs welcome.

Thanks,

Elias
  • 879
  • 1
  • 7
  • 13
  • In fact, I think you should always in Angular application, you should send Authorization header for authentication, Do you do this? – Ramin Azali May 06 '21 at 14:28
  • @RaminAzali No I wasn't aware of this. All I do at the moment is call the api endpoint and after a second or two a box appears asking the user to enter their username and password. I assumed this was being triggered by the iis authentication scheme. – Elias May 06 '21 at 14:55

1 Answers1

0

I understand this from your first paragraph

after your login you will get jwt token that token is the key to you for accessing you to other API's and you should Send this(the code below) header for authtentication as this Stackoverflow Link

Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

Sorry for my Bad English

Ramin Azali
  • 198
  • 11