Skip to content

Commit

Permalink
fix:issues 1085、915 (#1297)
Browse files Browse the repository at this point in the history
* fix: issues 1183、1166

* fix: issues 1291

* fix:Client token configuration not displayed

* fix:issues 1085、915
  • Loading branch information
wzh425 authored May 10, 2024
1 parent 8de0418 commit 81566a5
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ public void ClientTypeListAsync(ClientTypeListQuery clientTypeListQuery)
Description = ct switch
{
//todo: i18n
ClientTypes.Web => "Server-side applications where authentication and tokens are handled on the server (for example, Go, Java, ASP.Net, Node.js, PHP)",
ClientTypes.Native => "Desktop or mobile applications that run natively on a device and redirect users to a non-HTTP callback (for example, iOS, Android, React Native)",
ClientTypes.Spa => "Single-page web applications that run in the browser where the client receives tokens (for example, Javascript, Angular, React, Vue)",
ClientTypes.Device => "Input-constrained devices such as a smart TV, IoT device, or printer.",
ClientTypes.Machine => "Interact with APIs using the scoped OAuth 2.0 access tokens for machine-to-machine authentication.",
ClientTypes.Web => I18n.T("WebClientDescription"),
ClientTypes.Native => I18n.T("NativeClientDescription"),
ClientTypes.Spa => I18n.T("SpaClientDescription"),
ClientTypes.Device => I18n.T("DeviceClientDescription"),
ClientTypes.Machine => I18n.T("MachineClientDescription"),
_ => ""
},
Icon = ct switch
Expand Down
7 changes: 6 additions & 1 deletion src/Services/Masa.Auth.Service.Admin/Assets/I18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,10 @@
"PasswordFormatVerificationPrompt": "The password must be a combination of letters and numbers, and the length must not be less than 6",
"APIScopeNameExist": "API Scope exist this name",
"IdentitySourceNameExist": "Identity Source exist this name",
"WebhookNotExist": "The Webhook does not exist"
"WebhookNotExist": "The Webhook does not exist",
"WebClientDescription": "Server-side applications where authentication and tokens are handled on the server (for example, Go, Java, ASP.Net, Node.js, PHP)",
"NativeClientDescription": "Desktop or mobile applications that run natively on a device and redirect users to a non-HTTP callback (for example, iOS, Android, React Native)",
"SpaClientDescription": "Single-page web applications that run in the browser where the client receives tokens (for example, Javascript, Angular, React, Vue)",
"DeviceClientDescription": "Input-constrained devices such as a smart TV, IoT device, or printer.",
"MachineClientDescription": "Interact with APIs using the scoped OAuth 2.0 access tokens for machine-to-machine authentication."
}
7 changes: 6 additions & 1 deletion src/Services/Masa.Auth.Service.Admin/Assets/I18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,10 @@
"PasswordFormatVerificationPrompt": "密码必须是字母和数字的组合,且长度不小于6",
"APIScopeNameExist": "API 范围已存在该名称",
"IdentitySourceNameExist": "身份资源已存在该名称",
"WebhookNotExist": "Webhook记录不存在"
"WebhookNotExist": "Webhook记录不存在",
"WebClientDescription": "在服务器上处理身份验证和令牌的服务器端应用程序(例如,Go、Java、ASP.Net、Node.js、PHP)",
"NativeClientDescription": "在设备上本地运行并将用户重定向到非HTTP回调的桌面或移动应用程序(例如,iOS、Android、React Native)",
"SpaClientDescription": "在客户端接收令牌的浏览器中运行的单页web应用程序(例如,Javascript、Angular、React、Vue)",
"DeviceClientDescription": "输入受限的设备,如智能电视、物联网设备或打印机。",
"MachineClientDescription": "使用作用域OAuth 2.0访问令牌与API交互以进行机器对机器身份验证。"
}
1 change: 1 addition & 0 deletions src/Services/Masa.Auth.Service.Admin/_Imports.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
global using Masa.BuildingBlocks.StackSdks.Scheduler.Model;
global using Masa.BuildingBlocks.StackSdks.Scheduler.Request;
global using Masa.BuildingBlocks.Storage.ObjectStorage;
global using Masa.BuildingBlocks.Globalization.I18n;
global using Masa.Contrib.Authentication.OpenIdConnect.EFCore.Caches;
global using Masa.Contrib.Authentication.OpenIdConnect.EFCore.DbContexts;
global using Masa.Contrib.Authentication.OpenIdConnect.EFCore.Repositories;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<MCard Color="@(context.Active ? "hover-background" : "")" Height="244"
OnClick="()=>{ context.Toggle();TypeChanged.InvokeAsync(_clientType.ClientType); }">
<MCardTitle Class="d-flex justify-center h5">
<SIcon Size=24 Class="mr-2">@_clientType.Icon</SIcon> @_clientType.ClientType.ToString()
<SIcon Size=24 Class="mr-2">@_clientType.Icon</SIcon> @T(_clientType.ClientType.ToString())
</MCardTitle>
<MCardText>
@_clientType.Description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<DefaultTitle Class="mb-6">@T("BasicInformation")</DefaultTitle>
<MRow Class="mb-6 mt-12">
<MCol>
<STextField @bind-Value="ThirdPartyIdpDetail.Name" Required Disabled Label="@T("ThirdPartyIdp.Name")" />
<STextField @bind-Value="ThirdPartyIdpDetail.Name" Required Disabled Label="@T("Name")" />
</MCol>
<MCol>
<STextField @bind-Value="ThirdPartyIdp.DisplayName" Required Label="@T(nameof(ThirdPartyIdp.DisplayName))" />
Expand Down
43 changes: 43 additions & 0 deletions src/Web/Masa.Auth.Web.Admin.Rcl/wwwroot/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
},
"CustomLoginBlock": {
"TitleName": "Name",
"LogoUri": "Logo uri",
"ClientName": "Client name",
"NameRequired": "Name is required",
"DisplayNameRequired": "DisplayName is required",
"PhoneNumberAndEmailEmptyError": "One of phone number and email must have a value"
Expand Down Expand Up @@ -143,6 +145,16 @@
"Client": "Client",
"ClientBlock": {
"ClientId": "Client ID",
"ClientName": "Client name",
"ClientURL": "Client url",
"ClientType": "Client type",
"RequireConsent": "Require consent",
"AllowRememberConsent": "Allow remember consent",
"ConsentLifetime": "Consent lifetime",
"UserCodeType": "User code type",
"DeviceCodeLifetime": "Device code lifetime",
"RequireRequestObject": "Require request object",
"EnableLocalLogin": "Enable local login",
"UserSsoLifetime": "User SSO lifetime",
"AllowedCorsOrigins": "Allowed CORS origins",
"PostLogoutRedirectUri": "Post logout redirect URL",
Expand All @@ -157,6 +169,37 @@
},
"RepeatAdd": "Add Repeatedly",
"ThirdPartyIdpBlock": {
"DisplayName": "Display name",
"ClientId": "Client id",
"ClientSecret": "Client secret",
"AuthenticationTypes": "Authentication types",
"VerifyFile": "Verify file",
"AuthenticationType": "Authentication type",
"PlatformType": "Platform type",
"CallbackPath": "Callback path",
"AuthorizationEndpoint": "Authorization endpoint",
"TokenEndpoint": "Token endpoint",
"UserInformationEndpoint": "User information endpoint",
"LDAPAccountSynchronizPrompt": "LDAP account synchronization has been executed in the background, please check later"
},
"ThirdPartyUser": "Third party user",
"UserBlock": {
"UserState": "User state",
"CompanyName": "Company name"
},
"StaffBlock": {
"JobNumber": "Job number",
"StaffType": "Staff type",
"StaffSyncTemplate": "Staff sync template"
},
"RoleBlock": {
"RoleOwner": "Role owner"
},
"IdentityResourceBlock": {
"DisplayName": "Display name"
},
"Webhook": {
"WebhookEvent": "Webhook event",
"IsActive": "Is active"
}
}
2 changes: 1 addition & 1 deletion src/Web/Masa.Auth.Web.Admin.Rcl/wwwroot/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@
"AbsoluteRefreshTokenLifetimeTips": "刷新令牌的最长生命周期(秒)。默认为2592000秒/ 30天",
"SlidingRefreshTokenLifetime": "滑动刷新令牌生命周期",
"SlidingRefreshTokenLifetimeTips": "滑动刷新令牌的生命周期,以秒为单位。默认为1296000秒/ 15天",
"PairWiseSubjectSalt": "PairWiseSubjectSalt",
"PairWiseSubjectSalt": "一对一主体salt",
"PairWiseSubjectSaltTips": "客户端的用户,在生成的subjectId中使用的salt值。",
"IncludeJwtId": "嵌入Jwt唯一Id",
"IncludeJwtIdTips": "指定JWT访问令牌是否应具有嵌入的唯一ID(通过jti声明)。默认值为ture。",
Expand Down

0 comments on commit 81566a5

Please sign in to comment.