claims-based-identity

Is it safe to store an access_token in a user claim for authorization?

纵然是瞬间 提交于 2020-08-26 01:29:27
问题 So, I was having trouble with Bearer authentication while setting up IdentityServer4. Basically, I wasn't able to call my API resource and was getting a 401 error. When I added the Authorization header with the access_token. I was able to get the data from my web request. using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", authToken); var content = await client.GetStringAsync("http://localhost:5000/localapi"); } The way

How to make user return on login page after sign-up in Azure AD B2C?

风格不统一 提交于 2020-08-10 19:17:30
问题 When a user is signing-up in the system, he is automatically redirected to our application as a signed in user. I would like that after the sign-up, he is redirected to the signing page. I want this behavior since users need to be approved by an admin before having access to the system. I use custom policies. I tried to use the "SM-Noop" session manager but it is not working. There is my code: <!--Local account sign-up page--> <TechnicalProfile Id="LocalAccountSignUpWithLogonEmail">

Return simple string claim from custom policies in ADB2C

一笑奈何 提交于 2020-08-10 01:12:25
问题 I followed this article where it explains how to implement a custom policy using Active Directory B2C. Everything is working great, the only concern I have is that the custom claim is returned like a serialized object. Let me explain a little bit better. I successfully created the Azure Function which return the custom claim. The encoded resulting JWT is like the following (please focus on the " userPermissions " value): { "exp": 1594560277, "nbf": 1594556677, "ver": "1.0", "auth_time":

ASP.net core auth cookie not being set in Google Chrome when running in dev

核能气质少年 提交于 2020-07-05 05:37:09
问题 I have three applications in my solution, all built in asp.net core 1 MVC 6. App 1 is an MVC app used for authenticating a user. App 2 is an Angular SPA app and is the main app in the solution. App 3 is an MVC web api application. In app 3, I have the usual asp.net core SignInManager and UserManager code (the same code as you get by default when you start a new MVC 6 template - only different is, it exists in my web api here). And the login/logout/register etc is exposed via web api methods

ASP.NET Identity and Claims

半腔热情 提交于 2020-07-04 05:19:33
问题 I am trying to move away from WebForms and learn MVC, specifically using the new ASP.NET Identity model. However, I cant seem to find any formal documentation from Microsoft, that demonstrates how to create a claims object, and store it in a database for a authenticated user. My site, needs to do the following: Authentication a user - TICK Create a Claim, and store user information in it, so that I can use it throughout the session - NO TICK Pull back the users roles from the new ASP.NET

ASP.NET Core Identity impersonate specific user

淺唱寂寞╮ 提交于 2020-05-08 04:29:59
问题 Let's say I have the following roles: Admin User I want Admin role to impersonate specific user account with User role, but without knowing that specific user account's password. Admin should be able to impersonate any user from the application and be able to browse the application as the user himself. I found a link where this is actually implemented in ASP.NET MVC 4.6, but having a little headaches while converting this to Core version. Mostly because of the last line of code in the link

ASP.NET Core Identity impersonate specific user

淺唱寂寞╮ 提交于 2020-05-08 04:28:08
问题 Let's say I have the following roles: Admin User I want Admin role to impersonate specific user account with User role, but without knowing that specific user account's password. Admin should be able to impersonate any user from the application and be able to browse the application as the user himself. I found a link where this is actually implemented in ASP.NET MVC 4.6, but having a little headaches while converting this to Core version. Mostly because of the last line of code in the link