From b195d485b11ea4c55d5db3dd18b4eb76aa0b44a0 Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 1 Apr 2022 17:48:08 +0800 Subject: [PATCH] Add localized texts. --- .../Controllers/AuthorizeController.cs | 25 ++++++++----------- .../Controllers/OpenIdDictControllerBase.cs | 14 ++++++++++- .../TokenController.AuthorizationCode.cs | 4 +-- .../TokenController.ClientCredentials.cs | 2 +- .../Controllers/TokenController.DeviceCode.cs | 4 +-- .../TokenController.RefreshToken.cs | 4 +-- .../OpenIddict/Controllers/TokenController.cs | 13 ++++------ .../Controllers/UserInfoController.cs | 2 +- .../Views/Authorize/Authorize.cshtml | 8 ++++-- .../Abp/OpenIddict/Views/Logout/Logout.cshtml | 6 ++++- .../Volo.Abp.OpenIddict.Domain.Shared.csproj | 7 ++---- .../Localization/OpenIddict/en.json | 13 +++++++++- .../Localization/OpenIddict/zh-Hans.json | 23 ++++++++++++----- .../Localization/OpenIddict/zh-Hant.json | 15 +++++++++-- .../OpenIddict/AbpOpenIddictDomainModule.cs | 2 +- nupkg/common.ps1 | 12 ++++----- 16 files changed, 98 insertions(+), 56 deletions(-) diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/AuthorizeController.cs b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/AuthorizeController.cs index 96175edb53..6b676a71b5 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/AuthorizeController.cs +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/AuthorizeController.cs @@ -22,8 +22,7 @@ public class AuthorizeController : OpenIdDictControllerBase [IgnoreAntiforgeryToken] public virtual async Task HandleAsync() { - var request = HttpContext.GetOpenIddictServerRequest() ?? - throw new InvalidOperationException("The OpenID Connect request cannot be retrieved."); + var request = await GetOpenIddictServerRequest(HttpContext); // If prompt=login was specified by the client application, // immediately return the user agent to the login page. @@ -63,7 +62,7 @@ public class AuthorizeController : OpenIdDictControllerBase properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.LoginRequired, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The user is not logged in." + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = L["TheUserIsNotLoggedIn"] })); } @@ -78,11 +77,11 @@ public class AuthorizeController : OpenIdDictControllerBase // Retrieve the profile of the logged in user. var user = await UserManager.GetUserAsync(result.Principal) ?? - throw new InvalidOperationException("The user details cannot be retrieved."); + throw new InvalidOperationException(L["TheUserDetailsCannotBbeRetrieved"]); // Retrieve the application details from the database. var application = await ApplicationManager.FindByClientIdAsync(request.ClientId) ?? - throw new InvalidOperationException("Details concerning the calling client application cannot be found."); + throw new InvalidOperationException(L["DetailsConcerningTheCallingClientApplicationCannotBeFound"]); // Retrieve the permanent authorizations associated with the user and the calling client application. var authorizations = await AuthorizationManager.FindAsync( @@ -102,8 +101,7 @@ public class AuthorizeController : OpenIdDictControllerBase properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.ConsentRequired, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = - "The logged in user is not allowed to access this client application." + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = L["TheLoggedInUserIsNotAllowedToAccessThisClientApplication"] })); // If the consent is implicit or if an authorization was found, @@ -150,8 +148,7 @@ public class AuthorizeController : OpenIdDictControllerBase properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.ConsentRequired, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = - "Interactive user consent is required." + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = L["InteractiveUserConsentIsRequired"] })); // In every other case, render the consent form. @@ -168,16 +165,15 @@ public class AuthorizeController : OpenIdDictControllerBase [Authorize, AbpFormValueRequired("submit.Accept")] public virtual async Task HandleAcceptConsentAsync() { - var request = HttpContext.GetOpenIddictServerRequest() ?? - throw new InvalidOperationException("The OpenID Connect request cannot be retrieved."); + var request = await GetOpenIddictServerRequest(HttpContext); // Retrieve the profile of the logged in user. var user = await UserManager.GetUserAsync(User) ?? - throw new InvalidOperationException("The user details cannot be retrieved."); + throw new InvalidOperationException(L["TheUserDetailsCannotBbeRetrieved"]); // Retrieve the application details from the database. var application = await ApplicationManager.FindByClientIdAsync(request.ClientId) ?? - throw new InvalidOperationException("Details concerning the calling client application cannot be found."); + throw new InvalidOperationException(L["DetailsConcerningTheCallingClientApplicationCannotBeFound"]); // Retrieve the permanent authorizations associated with the user and the calling client application. var authorizations = await AuthorizationManager.FindAsync( @@ -197,8 +193,7 @@ public class AuthorizeController : OpenIdDictControllerBase properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.ConsentRequired, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = - "The logged in user is not allowed to access this client application." + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = L["TheLoggedInUserIsNotAllowedToAccessThisClientApplication"] })); } diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/OpenIdDictControllerBase.cs b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/OpenIdDictControllerBase.cs index 719dc9ec1d..13ec3bd996 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/OpenIdDictControllerBase.cs +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/OpenIdDictControllerBase.cs @@ -1,8 +1,11 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity; using OpenIddict.Abstractions; using Volo.Abp.AspNetCore.Mvc; @@ -27,6 +30,15 @@ public abstract class OpenIdDictControllerBase : AbpController LocalizationResource = typeof(AbpOpenIddictResource); } + + protected virtual Task GetOpenIddictServerRequest(HttpContext httpContext) + { + var request = HttpContext.GetOpenIddictServerRequest() ?? + throw new InvalidOperationException(L["TheOpenIDConnectRequestCannotBeRetrieved"]); + + return Task.FromResult(request); + } + protected virtual async Task> GetResourcesAsync(ImmutableArray scopes) { var resources = new List(); diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.AuthorizationCode.cs b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.AuthorizationCode.cs index 21755c64f0..eb615656d8 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.AuthorizationCode.cs +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.AuthorizationCode.cs @@ -26,7 +26,7 @@ public partial class TokenController properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The token is no longer valid." + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = L["TheTokenIsNoLongerValid"] })); } @@ -38,7 +38,7 @@ public partial class TokenController properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The user is no longer allowed to sign in." + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = L["TheUserIsNoLongerAllowedToSignIn"] })); } diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.ClientCredentials.cs b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.ClientCredentials.cs index 63c0dd5deb..0d0c26166a 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.ClientCredentials.cs +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.ClientCredentials.cs @@ -19,7 +19,7 @@ public partial class TokenController var application = await ApplicationManager.FindByClientIdAsync(request.ClientId); if (application == null) { - throw new InvalidOperationException("The application details cannot be found in the database."); + throw new InvalidOperationException(L["TheApplicationDetailsCannotBeFound"]); } // Create a new ClaimsIdentity containing the claims that diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.DeviceCode.cs b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.DeviceCode.cs index 7d0a72e8a4..f577dd19f9 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.DeviceCode.cs +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.DeviceCode.cs @@ -26,7 +26,7 @@ public partial class TokenController properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The token is no longer valid." + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = L["TheTokenIsNoLongerValid"] })); } @@ -38,7 +38,7 @@ public partial class TokenController properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The user is no longer allowed to sign in." + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = L["TheUserIsNoLongerAllowedToSignIn"] })); } diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.RefreshToken.cs b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.RefreshToken.cs index 7987b9aaf0..77fa72514e 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.RefreshToken.cs +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.RefreshToken.cs @@ -26,7 +26,7 @@ public partial class TokenController properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The token is no longer valid." + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = L["TheTokenIsNoLongerValid"] })); } @@ -38,7 +38,7 @@ public partial class TokenController properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The user is no longer allowed to sign in." + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = L["TheUserIsNoLongerAllowedToSignIn"] })); } diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.cs b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.cs index 461b2f1dd7..adde3c7a9f 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.cs +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.cs @@ -12,9 +12,7 @@ public partial class TokenController : OpenIdDictControllerBase [HttpGet, HttpPost, Produces("application/json")] public virtual async Task HandleAsync() { - var request = HttpContext.GetOpenIddictServerRequest() ?? - //TODO: L - throw new InvalidOperationException("The OpenID Connect request cannot be retrieved."); + var request = await GetOpenIddictServerRequest(HttpContext); if (request.IsPasswordGrantType()) { @@ -25,23 +23,22 @@ public partial class TokenController : OpenIdDictControllerBase { return await HandleAuthorizationCodeAsync(request); } - + if (request.IsRefreshTokenGrantType() ) { return await HandleRefreshTokenAsync(request); } - + if (request.IsDeviceCodeGrantType() ) { return await HandleDeviceCodeAsync(request); } - + if (request.IsClientCredentialsGrantType()) { return await HandleClientCredentialsAsync(request); } - //TODO: L - throw new NotImplementedException("The specified grant type is not implemented."); + throw new AbpException(string.Format(L["TheSpecifiedGrantTypeIsNotImplemented"], request.GrantType)); } } diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/UserInfoController.cs b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/UserInfoController.cs index 34272158ee..cd210dc1c9 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/UserInfoController.cs +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/UserInfoController.cs @@ -28,7 +28,7 @@ public class UserInfoController : OpenIdDictControllerBase properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidToken, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The specified access token is bound to an account that no longer exists." //TODO: L + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = L["TheSpecifiedAccessTokenIsBoundToAnAccountThatNoLongerExists"] })); } diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Views/Authorize/Authorize.cshtml b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Views/Authorize/Authorize.cshtml index 43beefa333..96f5597d10 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Views/Authorize/Authorize.cshtml +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Views/Authorize/Authorize.cshtml @@ -1,5 +1,9 @@ @using Microsoft.Extensions.Primitives +@using Microsoft.Extensions.Localization +@using Volo.Abp.OpenIddict.Localization @model AuthorizeViewModel +@inject IStringLocalizer L +

Authorization

Do you want to grant @Model.ApplicationName access to your data? (scopes requested: @Model.Scope)

@@ -12,7 +16,7 @@ } - - + +
diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Views/Logout/Logout.cshtml b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Views/Logout/Logout.cshtml index f57626a8e7..75c89f47db 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Views/Logout/Logout.cshtml +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Views/Logout/Logout.cshtml @@ -1,4 +1,8 @@ @using Microsoft.Extensions.Primitives +@using Microsoft.Extensions.Localization +@using Volo.Abp.OpenIddict.Localization +@model AuthorizeViewModel +@inject IStringLocalizer L

Log out

@@ -12,6 +16,6 @@ } - +
diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo.Abp.OpenIddict.Domain.Shared.csproj b/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo.Abp.OpenIddict.Domain.Shared.csproj index b226c5c054..043ad730e4 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo.Abp.OpenIddict.Domain.Shared.csproj +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo.Abp.OpenIddict.Domain.Shared.csproj @@ -18,11 +18,8 @@ - - - - - + + diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/en.json b/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/en.json index 4fc09ded10..689149766a 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/en.json +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/en.json @@ -6,6 +6,17 @@ "LoginIsNotAllowed": "You are not allowed to login! Your account is inactive or needs to confirm your email/phone number.", "InvalidUsername": "Invalid username or password!", "InvalidAuthenticatorCode": "Invalid authenticator code!", - "TheTargetUserIsNotLinkedToYou": "The target user is not linked to you!" + "TheTargetUserIsNotLinkedToYou": "The target user is not linked to you!", + "TheOpenIDConnectRequestCannotBeRetrieved": "The OpenID Connect request cannot be retrieved.", + "TheUserDetailsCannotBbeRetrieved" : "The user details cannot be retrieved.", + "TheApplicationDetailsCannotBeFound": "The application details cannot be found.", + "DetailsConcerningTheCallingClientApplicationCannotBeFound": "Details concerning the calling client application cannot be found.", + "TheSpecifiedGrantTypeIsNotImplemented.": "The specified grant type {0} is not implemented.", + "TheUserIsNotLoggedIn": "The user is not logged in.", + "TheLoggedInUserIsNotAllowedToAccessThisClientApplication": "The logged in user is not allowed to access this client application.", + "TheTokenIsNoLongerValid": "The token is no longer valid.", + "InteractiveUserConsentIsRequired": "Interactive user consent is required.", + "TheUserIsNoLongerAllowedToSignIn": "The user is no longer allowed to sign in.", + "TheSpecifiedAccessTokenIsBoundToAnAccountThatNoLongerExists": "The specified access token is bound to an account that no longer exists." } } diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hans.json b/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hans.json index d91966453d..92413b8ac3 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hans.json +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hans.json @@ -1,11 +1,22 @@ { "culture": "zh-Hans", "texts": { - "UserLockedOut": "登录失败,用户账户已被锁定.请稍后再试.", - "InvalidUserNameOrPassword": "用户名或密码错误!", - "LoginIsNotAllowed": "无法登录!你的账号未激活或者需要验证邮箱地址/手机号.", - "InvalidUsername": "用户名或密码错误!", - "InvalidAuthenticatorCode": "验证码无效!", - "TheTargetUserIsNotLinkedToYou": "目标用户未和你有关联!" + "UserLockedOut": "登錄失敗,用戶賬戶已被鎖定.請稍後再試.", + "InvalidUserNameOrPassword": "用戶名或密碼錯誤!", + "LoginIsNotAllowed": "無法登錄!妳的賬號未激活或者需要驗證郵箱地址/手機號.", + "InvalidUsername": "用戶名或密碼錯誤!", + "InvalidAuthenticatorCode": "驗證碼無效!", + "TheTargetUserIsNotLinkedToYou": "目標用戶未和妳有關聯!", + "TheOpenIDConnectRequestCannotBeRetrieved": "無法檢索 OpenID Connect 請求.", + "TheUserDetailsCannotBbeRetrieved" : "無法檢索用戶詳細信息.", + "TheApplicationDetailsCannotBeFound": "找不到應用詳情.", + "DetailsConcerningTheCallingClientApplicationCannotBeFound": "找不到有關調用客戶端應用程序的詳細信息.", + "TheSpecifiedGrantTypeIsNotImplemented.": "未實施指定的授權類型 {0}.", + "TheUserIsNotLoggedIn": "用戶未登錄.", + "TheLoggedInUserIsNotAllowedToAccessThisClientApplication": "登錄的用戶不允許訪問此客戶端應用程序.", + "TheTokenIsNoLongerValid": "令牌不再有效.", + "InteractiveUserConsentIsRequired": "需要交互式用戶同意.", + "TheUserIsNoLongerAllowedToSignIn": "不再允許用戶登錄.", + "TheSpecifiedAccessTokenIsBoundToAnAccountThatNoLongerExists": "指定的訪問令牌綁定到不再存在的帳戶." } } diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hant.json b/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hant.json index 209c439120..4f15fceb88 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hant.json +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hant.json @@ -6,6 +6,17 @@ "LoginIsNotAllowed": "無法登入!你的賬號未激活或者需要驗證郵箱地址/手機號碼.", "InvalidUsername": "用戶名或密碼錯誤!", "InvalidAuthenticatorCode": "驗證碼無效!", - "TheTargetUserIsNotLinkedToYou": "目標用戶與您無關!" + "TheTargetUserIsNotLinkedToYou": "目標用戶與您無關!", + "TheOpenIDConnectRequestCannotBeRetrieved": "无法检索 OpenID Connect 请求.", + "TheUserDetailsCannotBbeRetrieved" : "无法检索用户详细信息.", + "TheApplicationDetailsCannotBeFound": "找不到应用详情.", + "DetailsConcerningTheCallingClientApplicationCannotBeFound": "找不到有关调用客户端应用程序的详细信息.", + "TheSpecifiedGrantTypeIsNotImplemented.": "未实施指定的授权类型 {0}.", + "TheUserIsNotLoggedIn": "用户未登录.", + "TheLoggedInUserIsNotAllowedToAccessThisClientApplication": "登录的用户不允许访问此客户端应用程序.", + "TheTokenIsNoLongerValid": "令牌不再有效.", + "InteractiveUserConsentIsRequired": "需要交互式用户同意.", + "TheUserIsNoLongerAllowedToSignIn": "不再允许用户登录.", + "TheSpecifiedAccessTokenIsBoundToAnAccountThatNoLongerExists": "指定的访问令牌绑定到不再存在的帐户." } -} \ No newline at end of file +} diff --git a/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/AbpOpenIddictDomainModule.cs b/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/AbpOpenIddictDomainModule.cs index 13ff40155b..d2a752c2b1 100644 --- a/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/AbpOpenIddictDomainModule.cs +++ b/modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/AbpOpenIddictDomainModule.cs @@ -34,8 +34,8 @@ public class AbpOpenIddictDomainModule : AbpModule AbpClaimTypes.UserId = OpenIddictConstants.Claims.Subject; AbpClaimTypes.Role = OpenIddictConstants.Claims.Role; AbpClaimTypes.UserName = OpenIddictConstants.Claims.Name; - AbpClaimTypes.SurName = OpenIddictConstants.Claims.FamilyName; AbpClaimTypes.Name = OpenIddictConstants.Claims.GivenName; + AbpClaimTypes.SurName = OpenIddictConstants.Claims.FamilyName; AbpClaimTypes.PhoneNumber = OpenIddictConstants.Claims.PhoneNumber; AbpClaimTypes.PhoneNumberVerified = OpenIddictConstants.Claims.PhoneNumberVerified; AbpClaimTypes.Email = OpenIddictConstants.Claims.Email; diff --git a/nupkg/common.ps1 b/nupkg/common.ps1 index 9aeb64df0a..f9a40d6729 100644 --- a/nupkg/common.ps1 +++ b/nupkg/common.ps1 @@ -340,12 +340,12 @@ $projects = ( "modules/identityserver/src/Volo.Abp.IdentityServer.Installer", "studio/source-codes/Volo.Abp.IdentityServer.SourceCode", - # modules/OpenIddict - "modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain", - "modules/OpenIddict/src/Volo.Abp.OpenIddict.Domain.Shared", - "modules/OpenIddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore", - "modules/OpenIddict/src/Volo.Abp.OpenIddict.MongoDB", - + # modules/openiddict + "modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore", + "modules/openiddict/src/Volo.Abp.OpenIddict.Domain", + "modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared", + "modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore", + "modules/openiddict/src/Volo.Abp.OpenIddict.MongoDB", # modules/permission-management "modules/permission-management/src/Volo.Abp.PermissionManagement.Application.Contracts",