Activities of "lan.dang"

Thank you @maliming

Yeah, you are super man. It works now with adding pfx certificate. Do you know any reason why it does not add certificate to development by default? Anyway, it solved my problem Thank you

Yes here it is

public override void PreConfigureServices(ServiceConfigurationContext context)
{
    var hostingEnvironment = context.Services.GetHostingEnvironment();
    var configuration = context.Services.GetConfiguration();
    Console.WriteLine($"ContentRootPath: {hostingEnvironment.ContentRootPath}");
    PreConfigure<OpenIddictBuilder>(builder =>
    {
        builder.AddValidation(options =>
        {
            options.AddAudiences("StaffApp"); // Replace with your application name
            options.UseLocalServer();
            options.UseAspNetCore();
        });
    });
    if (!hostingEnvironment.IsDevelopment())
    {
        PreConfigure<AbpOpenIddictAspNetCoreOptions>(options =>
        {
            options.AddDevelopmentEncryptionAndSigningCertificate = false;
        });

        PreConfigure<OpenIddictServerBuilder>(serverBuilder =>
        {
            serverBuilder.AddProductionEncryptionAndSigningCertificate("openiddict.pfx", "aQLqG31Yphq4yDZWOVoajqcT3T2vYn");
            serverBuilder.SetAccessTokenLifetime(TimeSpan.FromHours(24));
            serverBuilder.SetAuthorizationCodeLifetime(TimeSpan.FromHours(24));
            serverBuilder.SetIdentityTokenLifetime(TimeSpan.FromHours(24));
        });
    }
}

Thank you

Hi maliming, As I understand, in development (run with Visual Studio) we do not need to add EncryptionAndSigningCertificate as it is added by default : "We've enabled AddDevelopmentEncryptionAndSigningCertificate by default on the development environment. It registers (and generates if necessary) a user-specific development encryption/development signing certificate. "

But when I run debug mode with Visual Studio I still get this error. What am I wrong?!

I still get another issue : CryptographicException: Keyset does not exist I found the same question is here : https://support.abp.io/QA/Questions/4872/CryptographicException-Keyset-does-not-exist I do not use IIS so I have added this code , my question is where do I store the Certificate file? In my another app (witt Blazor), it does not require me to store certificate in local. What is different?

Another error :( 2024-05-15 16:11:59.473 +07:00 [INF] The authorization request was rejected because the application 'StaffApp_App' was not allowed to use the authorization endpoint. 2024-05-15 16:11:59.495 +07:00 [INF] The response was successfully returned as a plain-text document: { "error": "unauthorized_client", "error_description": "This client application is not allowed to use the authorization endpoint.", "error_uri": "https://documentation.openiddict.com/errors/ID2046" }

The error is : The authorization request was rejected because the application 'StaffApp_App' was not allowed to use the 'StaffApp' scope.

After migrate to OpenIDDict I got this error https://localhost:44348/connect/authorize?response_type=code&client_id=StaffApp_App&state=SzZKbTVHY1FpS3pvb3JFVGgzbk9rSzVaUmJYRHI0eG1wWXJQNGE5Nlowcnlw&redirect_uri=http%3A%2F%2Flocalhost%3A4200&scope=openid%20offline_access%20StaffApp&code_challenge=Gh7WpwLQlnevdU7iEaDbIDoC6ujkx5uJRYfEV9rQH0A&code_challenge_method=S256&nonce=SzZKbTVHY1FpS3pvb3JFVGgzbk9rSzVaUmJYRHI0eG1wWXJQNGE5Nlowcnlw&culture=en-GB&ui-culture=en-GB

error:invalid_request error_description:This client application is not allowed to use the specified scope. error_uri:https://documentation.openiddict.com/errors/ID2051

What did I miss anything?

After upgrade from IdentityServer to OpenIdDict, when I run application it give error. What does it mean?

The result is here : { "localization": { "values": {

},
"resources": {

},
"languages": [
  {
    "cultureName": "en-GB",
    "uiCultureName": "en-GB",
    "displayName": "English",
    "twoLetterISOLanguageName": "en",
    "flagIcon": "gb"
  },
  {
    "cultureName": "fi",
    "uiCultureName": "fi",
    "displayName": "Suomi",
    "twoLetterISOLanguageName": "fi",
    "flagIcon": "fi"
  },
  {
    "cultureName": "sv",
    "uiCultureName": "sv",
    "displayName": "Svenska",
    "twoLetterISOLanguageName": "sv",
    "flagIcon": "se"
  },
  {
    "cultureName": "ru",
    "uiCultureName": "ru",
    "displayName": "Pусский",
    "twoLetterISOLanguageName": "ru",
    "flagIcon": "ru"
  },
  {
    "cultureName": "et",
    "uiCultureName": "et",
    "displayName": "Eestlane",
    "twoLetterISOLanguageName": "et",
    "flagIcon": "ee"
  },
  {
    "cultureName": "es",
    "uiCultureName": "es",
    "displayName": "Español",
    "twoLetterISOLanguageName": "es",
    "flagIcon": "es"
  }
],
"currentCulture": {
  "displayName": "English",
  "englishName": "English",
  "threeLetterIsoLanguageName": "eng",
  "twoLetterIsoLanguageName": "en",
  "isRightToLeft": false,
  "cultureName": "en",
  "name": "en",
  "nativeName": "English",
  "dateTimeFormat": {
    "calendarAlgorithmType": "SolarCalendar",
    "dateTimeFormatLong": "dddd, MMMM d, yyyy",
    "shortDatePattern": "M/d/yyyy",
    "fullDateTimePattern": "dddd, MMMM d, yyyy h:mm:ss tt",
    "dateSeparator": "/",
    "shortTimePattern": "h:mm tt",
    "longTimePattern": "h:mm:ss tt"
  }
},
"defaultResourceName": "StaffApp",
"languagesMap": {
  "bootstrap-datepicker": [
    {
      "name": "zh-Hans",
      "value": "zh-CN"
    },
    {
      "name": "zh-Hant",
      "value": "zh-TW"
    }
  ],
  "moment": [
    {
      "name": "zh-Hans",
      "value": "zh-cn"
    },
    {
      "name": "zh-Hant",
      "value": "zh-tw"
    },
    {
      "name": "de-DE",
      "value": "de"
    }
  ]
},
"languageFilesMap": {
  "bootstrap-datepicker": [
    {
      "name": "zh-Hans",
      "value": "zh-CN"
    },
    {
      "name": "zh-Hant",
      "value": "zh-TW"
    }
  ],
  "moment": [
    {
      "name": "zh-Hans",
      "value": "zh-cn"
    },
    {
      "name": "zh-Hant",
      "value": "zh-tw"
    },
    {
      "name": "de-DE",
      "value": "de"
    }
  ],
  "jquery.timeago": [
    {
      "name": "zh-Hans",
      "value": "zh-CN"
    },
    {
      "name": "zh-Hant",
      "value": "zh-TW"
    }
  ],
  "jquery-validation": [
    {
      "name": "zh-Hans",
      "value": "zh"
    },
    {
      "name": "zh-Hant",
      "value": "zh_TW"
    }
  ]
}

}, "auth": { "grantedPolicies": {

}

}, "setting": { "values": { "Abp.Localization.DefaultLanguage": "en", "Abp.Timing.TimeZone": "UTC", "Volo.Abp.LeptonTheme.Layout.Boxed": "False", "Volo.Abp.LeptonTheme.Layout.MenuPlacement": "Left", "Volo.Abp.LeptonTheme.Layout.MenuStatus": "AlwaysOpened", "Volo.Abp.LeptonTheme.Style": "Style6", "Volo.Abp.LeptonTheme.Style.PublicLayout": "Style1", "Abp.Identity.Password.RequiredLength": "6", "Abp.Identity.Password.RequiredUniqueChars": "1", "Abp.Identity.Password.RequireNonAlphanumeric": "True", "Abp.Identity.Password.RequireLowercase": "True", "Abp.Identity.Password.RequireUppercase": "True", "Abp.Identity.Password.RequireDigit": "True", "Abp.Identity.Password.ForceUsersToPeriodicallyChangePassword": "False", "Abp.Identity.Password.PasswordChangePeriodDays": "0", "Abp.Identity.Lockout.AllowedForNewUsers": "True", "Abp.Identity.Lockout.LockoutDuration": "300", "Abp.Identity.Lockout.MaxFailedAccessAttempts": "5", "Abp.Identity.SignIn.RequireConfirmedEmail": "False", "Abp.Identity.SignIn.EnablePhoneNumberConfirmation": "True", "Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "False", "Abp.Identity.User.IsUserNameUpdateEnabled": "True", "Abp.Identity.User.IsEmailUpdateEnabled": "True", "Abp.Identity.OrganizationUnit.MaxUserMembershipCount": "2147483647", "Abp.Identity.TwoFactor.Behaviour": "Optional", "Abp.Identity.TwoFactor.UsersCanChange": "True", "Abp.Account.EnableLdapLogin": "false", "Abp.Identity.EnableOAuthLogin": "false", "Abp.Identity.OAuthLogin.Authority": null, "Abp.Identity.OAuthLogin.ClientId": null, "Abp.Identity.OAuthLogin.ClientSecret": null, "Abp.Identity.OAuthLogin.Scope": null, "Abp.Identity.OAuthLogin.RequireHttpsMetadata": "false", "Abp.Identity.OAuthLogin.ValidateEndpoints": "false", "Abp.Identity.OAuthLogin.ValidateIssuerName": "false", "Abp.Account.IsSelfRegistrationEnabled": "true", "Abp.Account.EnableLocalLogin": "true", "Abp.Account.TwoFactorLogin.IsRememberBrowserEnabled": "true", "Abp.Account.Captcha.UseCaptchaOnLogin": "false", "Abp.Account.Captcha.UseCaptchaOnRegistration": "false", "Abp.Account.Captcha.VerifyBaseUrl": "https://www.google.com/", "Abp.Account.Captcha.SiteKey": null, "Abp.Account.Captcha.Version": "3", "Abp.Account.Captcha.Score": "0.5", "Abp.Account.ProfilePictureSource": "False" } }, "currentUser": { "isAuthenticated": false, "id": null, "tenantId": null, "impersonatorUserId": null, "impersonatorTenantId": null, "impersonatorUserName": null, "impersonatorTenantName": null, "userName": null, "name": null, "surName": null, "email": null, "emailVerified": false, "phoneNumber": null, "phoneNumberVerified": false, "roles": [] }, "features": { "values": { "Identity.TwoFactor": "Optional", "Identity.MaxUserCount": "0", "Account.EnableLdapLogin": "False", "Identity.EnableOAuthLogin": "False", "SettingManagement.Enable": "true", "SettingManagement.AllowChangingEmailSettings": "false", "LanguageManagement.Enable": "true", "TextManagement.Enable": "true", "LeptonManagement.Enable": "true", "AuditLogging.Enable": "true" } }, "globalFeatures": { "enabledFeatures": [] }, "multiTenancy": { "isEnabled": true }, "currentTenant": { "id": null, "name": null, "isAvailable": false }, "timing": { "timeZone": { "iana": { "timeZoneName": "Etc/UTC" }, "windows": { "timeZoneId": "UTC" } } }, "clock": { "kind": "Utc" }, "objectExtensions": { "modules": {

},
"enums": {

}

}, "extraProperties": {

} }

Zobrazeno od 1 do 10 z celkem 144 záznamů
Made with ❤️ on ABP v8.2.0-preview Updated on března 25, 2024, 15:11