We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to check if user has authenticated from multiple providers using oauth2!!

Hi, im building a sort of an spa app with angular and nodejs. This app will call some api from a provider that the user will choose and authenticate with. Now, I want to implement route guarding to prevent someone navigating to a route that displays api info while he is not authorized ( does not have access token ). My question is, what is the best practice to check if a user have an access token and is authorized while using multilple providers. I have thought about implementing REST endpoints from express.js for each provider and return if the user have an access token, therefore in my angular app I would have to request every endpoint and activate my route if authorized. However, I feel like this might not be the best solution. Should I assemble the logic to one endpoint in the backend ?


3 Replies

AB Ashokkumar Balasubramanian Syncfusion Team September 27, 2019 01:12 PM UTC

Hi jakabhai, 
 
Good day to you. 
 
Could you please refer the below documentation to achieve your requirement? 
 
 
 
Please let us know, if you need any further assistance on this. 
 
Regards, 
Ashokkumar B. 



JA jakabhai replied to jakabhai September 28, 2019 11:45 AM UTC

Hi, im building a sort of an spa app with angular and nodejs. This app will call some api from a provider that the user will choose and authenticate with. Now, I want to implement route guarding to prevent someone navigating to a route that displays api info while he is not authorized ( does not have access token ). My question is, what is the best practice to check if a user have an access token and is authorized while using multilple providers. I have thought about implementing REST endpoints from express.js for each provider and return if the user have an access token, therefore in my angular app I would have to request every endpoint and activate my route if authorized. However, I feel like this might not be the best solution. Should I assemble the logic to one endpoint in the backend ?


Hi, im building a sort of an spa app with angular and nodejs. This app will call some api from a provider that the user will choose and authenticate with. Now, I want to implement route guarding to prevent someone navigating to a route that displays api info while he is vshare not authorized ( does not have access token ). My question is, what is the best practice to check if a user have an access token and is authorized while using multilple providers. I have thought about implementing REST endpoints from express.js for each provider and return if the user have an access token, therefore in my angular app I would have to request every endpoint and activate my route if authorized. However, I feel like this might not be the best solution. Should I assemble the logic to one endpoint in the backend ?  https://discord.software/ FetLife



my issue got solved!!


AB Ashokkumar Balasubramanian Syncfusion Team September 30, 2019 09:11 AM UTC

Hi jakabhai,  
 
We are glad to hear that the problem has been resolved. Please let us know, if you need any further assistance. 
 
Regards, 
Ashokkumar B. 


Loader.
Live Chat Icon For mobile
Up arrow icon