Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • npack 42 posts 288 karma points
    Nov 30, 2023 @ 19:14
    npack
    0

    External Login Providers - OpenId - Incorrect example, or missing dependency?

    I'm trying to use an external openid backoffice authentication provider following the steps on https://docs.umbraco.com/umbraco-cms/reference/security/external-login-providers/

    In the article there is an example of a custom backoffice authentication provider, but It isn't compiling for me. Visual studio is telling me "AddProvider" is not a method. I do have access to an "AddOauth" method but I want to use OpenId Connect, not just OAuth2.

    I am using Umbraco 12.3.3. Do you think I am missing some dependency, am I on the wrong version, or is there a problem with the example code?

    public static class ProviderBackofficeAuthenticationExtensions {

    public static IUmbracoBuilder AddProviderBackofficeAuthentication(this IUmbracoBuilder builder)
    {
        // [OPTIONAL]
        // Register ProviderBackOfficeExternalLoginProviderOptions here rather than require it in startup
        builder.Services.ConfigureOptions<ProviderBackOfficeExternalLoginProviderOptions>();
        builder.AddBackOfficeExternalLogins(logins =>
        {
            logins.AddBackOfficeLogin(
                backOfficeAuthenticationBuilder =>
                {
                    backOfficeAuthenticationBuilder.AddProvider(  // <-- Right HERE
                        backOfficeAuthenticationBuilder.SchemeForBackOffice(ProviderBackOfficeExternalLoginProviderOptions.SchemeName),
                        options =>
                        {
    
Please Sign in or register to post replies

Write your reply to:

Draft