Access Token is null for blazor web app integrated with Okta

I followed this post Goodbye Javascript! Build an Authenticated Web App in C# with Blazor + ASP.NET Core 3.0 - #15 by oktadev-blog and have the blazor web app okta integration working. However the access token in app.razor is empty. In _Host.cshtml, the HttpContext.Request.Query has no keys.

Hello Priya,

This is Akash from Okta and I will be assisting you with this issue.

For the issue that you are facing, you will need to check same site policy. For example,

Instead of using .AddCookie()
use:
.AddCookie(options => { options.Cookie.SameSite = SameSiteMode.None; options.Cookie.SecurePolicy = CookieSecurePolicy.Always; options.Cookie.IsEssential = true; });

Please let me know if that fixes the issue. Otherwise, you can also refer to out Blazor sample -
Add user authentication and Okta Resource Management to your Blazor app | Okta Developer

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.