C
C#15mo ago
gino9872

❔ ASP.net Azure Authentication

Basically I followed this tutorial https://www.youtube.com/watch?v=pS1hER46PQI. At the point where he obtains the bearer token, and makes a request to his controller, I get a 401 response from my request in postman. Does someone has an idea why this is happening? I only made one role tho.
AzureTeach•Net
YouTube
.Net Core Web API Azure AD Authentication and Authorization
In this video I have demonstrated Securing WebAPI with Azure Active Directory Authentication and Authorization using .Net Core. In Asp.Net Core Web API, Authentication is the process of obtaining some kind of credentials from the users and using those credentials to check the user's identity. Authorization is the process of allowing an authentic...
8 Replies
friedice
friedice15mo ago
did your postman request have your auth token
gino9872
gino9872OP15mo ago
yes
friedice
friedice15mo ago
what was your authorization attribute in your controller and was the role added to your token? it also helps with some $codegif
gino9872
gino9872OP15mo ago
just [Authorize] at the top of the controller. Where can I see the role that is added to a token? the thing also is, when im in my application on azure, there is no unique endpoints, only when im in the complete organization. I think i dont have my own endpoints or something So i get https://login.microsoftonline.com/common/oauth2/token, in my own application, but a endpoints with and ID or some string in the organization apps
friedice
friedice15mo ago
if you can grab your token, you can get your claims with something like https://jwt.io
JWT.IO
JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties.
friedice
friedice15mo ago
this is my first time hearing about this kind of approach. What are the benefits to this in comparison to making your own api?
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server