Skip to content

[Blazor][Wasm] Set oidc Authentication Options in local storage #20574

Closed
@StPaulis

Description

@StPaulis

Packages Version="3.2.0-preview3.20168.3"

I have just implemented the oidc authentication in a Client Side Blazor application according to the documentation.

Problem

The problem is that the oidc response is saved in the session storage by default and I haven't find a way to configure it.

Suggestion

I would like to have an option to choose the Storage Type ('session' or 'local') when configuring the service on startup: authentication-service-support.

Something like this :

services.AddOidcAuthentication(options =>

            {

                options.ProviderOptions.Authority = frontEndOptions.AuthorityUrl;

                options.ProviderOptions.ClientId = frontEndOptions.UiClientId;

                options.ProviderOptions.DefaultScopes = frontEndOptions.Scope.Split(' ');

                options.ProviderOptions.PostLogoutRedirectUri = frontEndOptions.PostLogoutRedirectUrl;

                options.ProviderOptions.RedirectUri = redirectUrl;

                options.ProviderOptions.ResponseType = "id_token token";

                // The line below is the suggestion
                **options.ProviderOptions.StorageType = "local";** 

            });

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor Componentsfeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyquestion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions