Net Identity Bearer Token Expiration
>> YOUR LINK HERE: ___ http://youtube.com/watch?v=L1F-ck_uqdI
Hello everyone! I hope this video has helped solve your questions and issues. This video is shared because a solution has been found for the question/problem. I create videos for questions that have solutions. If you have any other issues, feel free to reach out to me on Instagram: / ky.emrah • Below, you can find the text related to the question/problem. In the video, the question will be presented first, followed by the answers. If the video moves too fast, feel free to pause and review the answers. If you need more detailed information, you can find the necessary sources and links at the bottom of this description. I hope this video has been helpful, and even if it doesn't directly solve your problem, it will guide you to the source of the solution. I'd appreciate it if you like the video and subscribe to my channel!.Net Identity Bearer Token Expiration • I have different login methods for mobile and web application in .net webapi identity backend. Both clients are using ssame authentication scheme(IdentityConstants.BearerScheme). But I want to change expirations time for my clients. For example for my mobile 14 days, for my web 1 day. Is there any way to change token expiration dynamically in method? • Login for web: • Login for web: • _signInManager.AuthenticationScheme = IdentityConstants.BearerScheme; • var result = await _signInManager.PasswordSignInAsync(loginForVisionRequest.Email, loginForVisionRequest.Password, isPersistent: false, lockoutOnFailure: true); • //make token expiration 14 days • if (!result.Succeeded) • { • return TypedResults.Problem( Unauthorized , statusCode: 401); • } • return TypedResults.Empty; • _signInManager.AuthenticationScheme = IdentityConstants.BearerScheme; • var result = await _signInManager.PasswordSignInAsync(loginForVisionRequest.Email, loginForVisionRequest.Password, isPersistent: false, lockoutOnFailure: true); • //make token expiration 14 days • if (!result.Succeeded) • { • return TypedResults.Problem( Unauthorized , statusCode: 401); • } • return TypedResults.Empty; • Login for mobile: • Login for mobile: • _signInManager.AuthenticationScheme = IdentityConstants.BearerScheme; • var result = await _signInManager.PasswordSignInAsync(loginForVisionRequest.Email, loginForVisionRequest.Password, isPersistent: false, lockoutOnFailure: true); • //make token validation 1 day • if (!result.Succeeded) • { • return TypedResults.Problem( Unauthorized , statusCode: 401); • } • return TypedResults.Empty; • _signInManager.AuthenticationScheme = IdentityConstants.BearerScheme; • var result = await _signInManager.PasswordSignInAsync(loginForVisionRequest.Email, loginForVisionRequest.Password, isPersistent: false, lockoutOnFailure: true); • //make token validation 1 day • if (!result.Succeeded) • { • return TypedResults.Problem( Unauthorized , statusCode: 401); • } • return TypedResults.Empty; • I tried to use different schemes but I have to use BearerAuthentication but not JWT. • • Tags: .net,asp.net-identity,identity,bearer-tokenSource of the question: • https://stackoverflow.com/questions/7... • Question and source license information: • https://meta.stackexchange.com/help/l... • https://stackoverflow.com/
#############################