Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: return matched userinfo in testing idp (#16594)

boojack935be12cb945
diff --git a/backend/api/v1/auth_service.go b/backend/api/v1/auth_service.go
index 9f4da5a526..0daf07a450 100644
--- a/backend/api/v1/auth_service.go
+++ b/backend/api/v1/auth_service.go
@@ -366,9 +366,11 @@ func (s *AuthService) getOrCreateUserWithIDP(ctx context.Context, request *v1pb.
return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("identity provider type %s not supported", idp.Type.String()))
}
if userInfo == nil {
- return nil, connect.NewError(connect.CodeNotFound, errors.Errorf("identity provider user info not found"))
+ return nil, connect.NewError(connect.CodeNotFound, errors.Errorf("failed to get user info from identity provider %q", idp.Title))
+ }
+ if userInfo.Identifier == "" {
+ return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("missing identifier in user info from identity provider %q", idp.Title))
}
-
// The userinfo's email comes from identity provider, it has to be converted to lower-case.
email := strings.ToLower(userInfo.Identifier)
if err := validateEmail(email); err != nil {
diff --git a/backend/api/v1/idp_service.go b/backend/api/v1/idp_service.go
index df9f17f6dd..1fce695d81 100644
--- a/backend/api/v1/idp_service.go
+++ b/backend/api/v1/idp_service.go
@@ -257,17 +257,28 @@ func (s *IdentityProviderService) TestIdentityProvider(ctx context.Context, req
if err != nil {
return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("failed to exchange access token, error: %s", err.Error()))
}
- _, claims, err := oauth2IdentityProvider.UserInfo(token)
+ userInfo, claims, err := oauth2IdentityProvider.UserInfo(token)
if err != nil {
return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("failed to get user info, error: %s", err.Error()))
}
- // Convert claims to map[string]string for protobuf
- stringClaims := make(map[string]string)
+ claimsMap := make(map[string]string)
for key, value := range claims {
- stringClaims[key] = fmt.Sprintf("%v", value)
+ claimsMap[key] = fmt.Sprintf("%v", value)
}
- return connect.NewResponse(&v1pb.TestIdentityProviderResponse{Claims: stringClaims}), nil
+ userInfoMap := make(map[string]string)
+ if userInfo != nil {
+ if userInfo.Identifier != "" {
+ userInfoMap["email"] = userInfo.Identifier
+ }
+ if userInfo.DisplayName != "" {
+ userInfoMap["title"] = userInfo.DisplayName
+ }
+ if userInfo.Phone != "" {
+ userInfoMap["phone"] = userInfo.Phone
+ }
+ }
+ return connect.NewResponse(&v1pb.TestIdentityProviderResponse{Claims: claimsMap, UserInfo: userInfoMap}), nil
case v1pb.IdentityProviderType_OIDC:
// Find client secret for those existed identity providers.
if identityProvider.Config.GetOidcConfig().ClientSecret == "" {
@@ -295,17 +306,31 @@ func (s *IdentityProviderService) TestIdentityProvider(ctx context.Context, req
if err != nil {
return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("failed to exchange access token, error: %s", err.Error()))
}
- _, claims, err := oidcIdentityProvider.UserInfo(ctx, token, "")
+ userInfo, claims, err := oidcIdentityProvider.UserInfo(ctx, token, "")
if err != nil {
return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("failed to get user info, error: %s", err.Error()))
}
- // Convert claims to map[string]string for protobuf
- stringClaims := make(map[string]string)
+ claimsMap := make(map[string]string)
for key, value := range claims {
- stringClaims[key] = fmt.Sprintf("%v", value)
+ claimsMap[key] = fmt.Sprintf("%v", value)
+ }
+ userInfoMap := make(map[string]string)
+ if userInfo != nil {
+ if userInfo.Identifier != "" {
+ userInfoMap["email"] = userInfo.Identifier
+ }
+ if userInfo.DisplayName != "" {
+ userInfoMap["title"] = userInfo.DisplayName
+ }
+ if userInfo.Phone != "" {
+ userInfoMap["phone"] = userInfo.Phone
+ }
+ if userInfo.Groups != nil {
+ userInfoMap["groups"] = fmt.Sprintf("%v", userInfo.Groups)
+ }
}
- return connect.NewResponse(&v1pb.TestIdentityProviderResponse{Claims: stringClaims}), nil
+ return connect.NewResponse(&v1pb.TestIdentityProviderResponse{Claims: claimsMap, UserInfo: userInfoMap}), nil
case v1pb.IdentityProviderType_LDAP:
// Retrieve bind password from stored identity provider if not provided.
if identityProvider.Config.GetLdapConfig().BindPassword == "" {
@@ -342,7 +367,7 @@ func (s *IdentityProviderService) TestIdentityProvider(ctx context.Context, req
}
_ = conn.Close()
- // LDAP doesn't return claims like OAuth2/OIDC, so return empty claims
+ // LDAP cannot return claims without username and password so we return an empty claims map.
return connect.NewResponse(&v1pb.TestIdentityProviderResponse{Claims: make(map[string]string)}), nil
default:
return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("identity provider type %s not supported", identityProvider.Type.String()))
diff --git a/backend/plugin/idp/ldap/ldap.go b/backend/plugin/idp/ldap/ldap.go
index 4cbf88f877..cd934f84c1 100644
--- a/backend/plugin/idp/ldap/ldap.go
+++ b/backend/plugin/idp/ldap/ldap.go
@@ -160,9 +160,6 @@ func (p *IdentityProvider) Authenticate(username, password string) (*storepb.Ide
}
identifier := entry.GetAttributeValue(p.config.FieldMapping.Identifier)
- if identifier == "" {
- return nil, errors.Errorf("the attribute %q is not found or has empty value", p.config.FieldMapping.Identifier)
- }
return &storepb.IdentityProviderUserInfo{
Identifier: identifier,
DisplayName: entry.GetAttributeValue(p.config.FieldMapping.DisplayName),
diff --git a/backend/plugin/idp/oauth2/oauth2.go b/backend/plugin/idp/oauth2/oauth2.go
index b3ddf42c4d..70656e8f7c 100644
--- a/backend/plugin/idp/oauth2/oauth2.go
+++ b/backend/plugin/idp/oauth2/oauth2.go
@@ -116,12 +116,6 @@ func (p *IdentityProvider) UserInfo(token string) (*storepb.IdentityProviderUser
if v, ok := idp.GetValueWithKey(claims, p.config.FieldMapping.Identifier).(string); ok {
userInfo.Identifier = v
}
- if userInfo.Identifier == "" {
- slog.Error("Missing identifier in response body", slog.String("token", token), slog.Any("claims", claims))
- return nil, claims, errors.Errorf("the field %q is not found in claims or has empty value", p.config.FieldMapping.Identifier)
- }
-
- // Best effort to map optional fields.
if p.config.FieldMapping.DisplayName != "" {
if v, ok := idp.GetValueWithKey(claims, p.config.FieldMapping.DisplayName).(string); ok {
userInfo.DisplayName = v
diff --git a/backend/plugin/idp/oidc/oidc.go b/backend/plugin/idp/oidc/oidc.go
index 68d34c85a5..76cd726e80 100644
--- a/backend/plugin/idp/oidc/oidc.go
+++ b/backend/plugin/idp/oidc/oidc.go
@@ -128,11 +128,6 @@ func (p *IdentityProvider) UserInfo(ctx context.Context, token *oauth2.Token, no
if v, ok := idp.GetValueWithKey(claims, p.config.FieldMapping.Identifier).(string); ok {
userInfo.Identifier = v
}
- if userInfo.Identifier == "" {
- return nil, claims, errors.Errorf("the field %q is not found in claims or has empty value", p.config.FieldMapping.Identifier)
- }
-
- // Best effort to map optional fields
if p.config.FieldMapping.DisplayName != "" {
if v, ok := idp.GetValueWithKey(claims, p.config.FieldMapping.DisplayName).(string); ok {
userInfo.DisplayName = v
diff --git a/frontend/src/components/IdentityProvider/TestConnection.vue b/frontend/src/components/IdentityProvider/TestConnection.vue
index 01f7bac314..6c8fedeb4a 100644
--- a/frontend/src/components/IdentityProvider/TestConnection.vue
+++ b/frontend/src/components/IdentityProvider/TestConnection.vue
@@ -21,21 +21,44 @@
<span>{{ $t("identity-provider.test-connection-success") }}</span>
</div>
</template>
- <div class="space-y-4">
+ <div v-if="testIdentityProviderResponse" class="space-y-4">
+ <p class="text-sm text-control-light">
+ {{ $t("identity-provider.userinfo-description") }}
+ </p>
+ <div class="bg-gray-50 dark:bg-gray-800 rounded-lg p-4">
+ <div class="space-y-2">
+ <div
+ v-for="[key, value] in Object.entries(
+ testIdentityProviderResponse.userInfo
+ )"
+ :key="key"
+ class="grid grid-cols-3 gap-2 py-1 border-b border-gray-200 dark:border-gray-600 last:border-b-0"
+ >
+ <div class="text-sm font-medium text-control truncate" :title="key">
+ {{ key }}
+ </div>
+ <div class="col-span-2 text-sm text-main break-all" :title="value">
+ {{ value }}
+ </div>
+ </div>
+ </div>
+ </div>
<p class="text-sm text-control-light">
{{ $t("identity-provider.claims-description") }}
</p>
<div class="bg-gray-50 dark:bg-gray-800 rounded-lg p-4">
<div class="space-y-2">
<div
- v-if="Object.keys(claims).length === 0"
+ v-if="Object.keys(testIdentityProviderResponse.claims).length === 0"
class="text-sm text-control-light italic"
>
{{ $t("identity-provider.no-claims") }}
</div>
- <div v-else>
+ <template v-else>
<div
- v-for="[key, value] in Object.entries(claims)"
+ v-for="[key, value] in Object.entries(
+ testIdentityProviderResponse.claims
+ )"
:key="key"
class="grid grid-cols-3 gap-2 py-1 border-b border-gray-200 dark:border-gray-600 last:border-b-0"
>
@@ -52,10 +75,15 @@
{{ value }}
</div>
</div>
- </div>
+ </template>
</div>
</div>
</div>
+ <div v-else>
+ <p class="text-sm text-control-light">
+ No user info or claims available for this identity provider.
+ </p>
+ </div>
</NModal>
</template>
@@ -67,6 +95,7 @@ import { pushNotification } from "@/store";
import type { OAuthWindowEventPayload } from "@/types";
import {
IdentityProviderType,
+ TestIdentityProviderResponse,
type IdentityProvider,
} from "@/types/proto/v1/idp_service";
import { openWindowForSSO } from "@/utils";
@@ -78,7 +107,9 @@ const props = defineProps<{
// Reactive state for the claims dialog
const showClaimsDialog = ref(false);
-const claims = ref<Record<string, string>>({});
+const testIdentityProviderResponse = ref<TestIdentityProviderResponse | null>(
+ null
+);
// Track current event listener to prevent duplicates
const currentEventName = ref<string>("");
@@ -113,8 +144,7 @@ const loginWithIdentityProviderEventListener = async (event: Event) => {
},
});
- // Show claims in dialog
- claims.value = response.claims || {};
+ testIdentityProviderResponse.value = response;
showClaimsDialog.value = true;
} catch (error) {
pushNotification({
@@ -186,7 +216,7 @@ const testConnection = async () => {
});
// Show claims in dialog (LDAP will have empty claims)
- claims.value = response.claims || {};
+ testIdentityProviderResponse.value = response;
showClaimsDialog.value = true;
} catch (error) {
pushNotification({
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 7f9063521c..2afff3a61c 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -2300,6 +2300,7 @@
"identity-provider": {
"test-connection": "Test Connection",
"test-connection-success": "Test Connection Successful",
+ "userinfo-description": "The matched user information.",
"claims-description": "The following claims were returned by the identity provider. This information can help you configure field mappings.",
"no-claims": "No claims returned by the identity provider.",
"identity-provider-created": "Identity provider created successfully",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index e72605cb34..f881dc0ae6 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -2300,6 +2300,7 @@
"identity-provider": {
"test-connection": "Probar conexión",
"test-connection-success": "Conexión de prueba exitosa",
+ "userinfo-description": "La información del usuario coincidente.",
"claims-description": "El proveedor de identidad devolvió las siguientes notificaciones. Esta información puede ayudarle a configurar las asignaciones de campos.",
"no-claims": "El proveedor de identidad no devolvió ninguna reclamación.",
"identity-provider-created": "Proveedor de identidad creado exitosamente",
@@ -2793,4 +2794,4 @@
"last-visit": "Última visita",
"changelog-for-version": "Registro de cambios para {version}"
}
-}
+}
\ No newline at end of file
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 60644a1fe7..2926a547c5 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -2300,6 +2300,7 @@
"identity-provider": {
"test-connection": "テスト接続",
"test-connection-success": "テスト接続に成功しました",
+ "userinfo-description": "一致したユーザー情報。",
"claims-description": "IDプロバイダーから以下のクレームが返されました。この情報は、フィールドマッピングの設定に役立ちます。",
"no-claims": "アイデンティティ プロバイダーから返されるクレームはありません。",
"identity-provider-created": "ID プロバイダが正常に作成されました",
@@ -2793,4 +2794,4 @@
"last-visit": "最終訪問",
"changelog-for-version": "{version} の変更履歴"
}
-}
+}
\ No newline at end of file
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 9dae0d1b5f..79d8fca0f4 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -2300,6 +2300,7 @@
"identity-provider": {
"test-connection": "Kiểm tra kết nối",
"test-connection-success": "Kiểm tra kết nối thành công",
+ "userinfo-description": "Thông tin người dùng đã khớp.",
"claims-description": "Các yêu cầu sau đây đã được nhà cung cấp danh tính trả về. Thông tin này có thể giúp bạn cấu hình ánh xạ trường.",
"no-claims": "Nhà cung cấp danh tính không trả lại bất kỳ khiếu nại nào.",
"identity-provider-created": "Nhà cung cấp danh tính đã được tạo thành công",
@@ -2793,4 +2794,4 @@
"last-visit": "Lần truy cập cuối",
"changelog-for-version": "Nhật ký thay đổi cho phiên bản {version}"
}
-}
+}
\ No newline at end of file
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 6c3a8c8d1f..a818359677 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -2300,6 +2300,7 @@
"identity-provider": {
"test-connection": "测试连接",
"test-connection-success": "测试连接成功",
+ "userinfo-description": "匹配到的用户信息。",
"claims-description": "身份提供商返回了以下 claims。此信息可帮助您配置用户信息映射。",
"no-claims": "身份提供商未返回 claims。",
"identity-provider-created": "身份提供商创建成功",
@@ -2793,4 +2794,4 @@
"last-visit": "上次访问",
"changelog-for-version": "{version} 的更新日志"
}
-}
+}
\ No newline at end of file
diff --git a/frontend/src/types/proto-es/v1/idp_service_pb.d.ts b/frontend/src/types/proto-es/v1/idp_service_pb.d.ts
index b55e2b3215..f1bade0e20 100644
--- a/frontend/src/types/proto-es/v1/idp_service_pb.d.ts
+++ b/frontend/src/types/proto-es/v1/idp_service_pb.d.ts
@@ -227,6 +227,13 @@ export declare type TestIdentityProviderResponse = Message<"bytebase.v1.TestIden
* @generated from field: map<string, string> claims = 1;
*/
claims: { [key: string]: string };
+
+ /**
+ * The matched user info from the claims.
+ *
+ * @generated from field: map<string, string> user_info = 2;
+ */
+ userInfo: { [key: string]: string };
};
/**
diff --git a/frontend/src/types/proto-es/v1/idp_service_pb.js b/frontend/src/types/proto-es/v1/idp_service_pb.js
index 5df6b5e83a..b85a3f9b24 100644
--- a/frontend/src/types/proto-es/v1/idp_service_pb.js
+++ b/frontend/src/types/proto-es/v1/idp_service_pb.js
@@ -14,7 +14,7 @@ import { file_v1_annotation } from "./annotation_pb";
* Describes the file v1/idp_service.proto.
*/
export const file_v1_idp_service = /*@__PURE__*/
- fileDesc("ChR2MS9pZHBfc2VydmljZS5wcm90bxILYnl0ZWJhc2UudjEiRQoaR2V0SWRlbnRpdHlQcm92aWRlclJlcXVlc3QSJwoEbmFtZRgBIAEoCUIZ4kEBAvpBEgoQYnl0ZWJhc2UuY29tL0lkUCJFChxMaXN0SWRlbnRpdHlQcm92aWRlcnNSZXF1ZXN0EhEKCXBhZ2Vfc2l6ZRgBIAEoBRISCgpwYWdlX3Rva2VuGAIgASgJInMKHUxpc3RJZGVudGl0eVByb3ZpZGVyc1Jlc3BvbnNlEjkKEmlkZW50aXR5X3Byb3ZpZGVycxgBIAMoCzIdLmJ5dGViYXNlLnYxLklkZW50aXR5UHJvdmlkZXISFwoPbmV4dF9wYWdlX3Rva2VuGAIgASgJIpQBCh1DcmVhdGVJZGVudGl0eVByb3ZpZGVyUmVxdWVzdBI+ChFpZGVudGl0eV9wcm92aWRlchgBIAEoCzIdLmJ5dGViYXNlLnYxLklkZW50aXR5UHJvdmlkZXJCBOJBAQISHAoUaWRlbnRpdHlfcHJvdmlkZXJfaWQYAiABKAkSFQoNdmFsaWRhdGVfb25seRgDIAEoCCKQAQodVXBkYXRlSWRlbnRpdHlQcm92aWRlclJlcXVlc3QSPgoRaWRlbnRpdHlfcHJvdmlkZXIYASABKAsyHS5ieXRlYmFzZS52MS5JZGVudGl0eVByb3ZpZGVyQgTiQQECEi8KC3VwZGF0ZV9tYXNrGAIgASgLMhouZ29vZ2xlLnByb3RvYnVmLkZpZWxkTWFzayJICh1EZWxldGVJZGVudGl0eVByb3ZpZGVyUmVxdWVzdBInCgRuYW1lGAEgASgJQhniQQEC+kESChBieXRlYmFzZS5jb20vSWRQIrMBChtUZXN0SWRlbnRpdHlQcm92aWRlclJlcXVlc3QSOAoRaWRlbnRpdHlfcHJvdmlkZXIYASABKAs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Byb3ZpZGVyIggvdjEvaWRwcxLrAQoWVXBkYXRlSWRlbnRpdHlQcm92aWRlchIqLmJ5dGViYXNlLnYxLlVwZGF0ZUlkZW50aXR5UHJvdmlkZXJSZXF1ZXN0Gh0uYnl0ZWJhc2UudjEuSWRlbnRpdHlQcm92aWRlciKFAdpBHWlkZW50aXR5X3Byb3ZpZGVyLHVwZGF0ZV9tYXNriuowG2JiLmlkZW50aXR5UHJvdmlkZXJzLnVwZGF0ZZDqMAGY6jABgtPkkwI4OhFpZGVudGl0eV9wcm92aWRlcjIjL3YxL3tpZGVudGl0eV9wcm92aWRlci5uYW1lPWlkcHMvKn0SpQEKFkRlbGV0ZUlkZW50aXR5UHJvdmlkZXISKi5ieXRlYmFzZS52MS5EZWxldGVJZGVudGl0eVByb3ZpZGVyUmVxdWVzdBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSJH2kEEbmFtZYrqMBtiYi5pZGVudGl0eVByb3ZpZGVycy5kZWxldGWQ6jABmOowAYLT5JMCEyoRL3YxL3tuYW1lPWlkcHMvKn0SqgEKFFRlc3RJZGVudGl0eVByb3ZpZGVyEiguYnl0ZWJhc2UudjEuVGVzdElkZW50aXR5UHJvdmlkZXJSZXF1ZXN0GikuYnl0ZWJhc2UudjEuVGVzdElkZW50aXR5UHJvdmlkZXJSZXNwb25zZSI9iuowG2JiLmlkZW50aXR5UHJvdmlkZXJzLnVwZGF0ZZDqMAGC0+STAhQ6ASoiDy92MS9pZHBzLyo6dGVzdEI0WjJnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL3Byb3RvL2dlbmVyYXRlZC1nby92MWIGcHJvdG8z", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_field_mask, file_v1_annotation]);
+ fileDesc("ChR2MS9pZHBfc2VydmljZS5wcm90bxILYnl0ZWJhc2UudjEiRQoaR2V0SWRlbnRpdHlQcm92aWRlclJlcXVlc3QSJwoEbmFtZR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pZHBzEusBChZVcGRhdGVJZGVudGl0eVByb3ZpZGVyEiouYnl0ZWJhc2UudjEuVXBkYXRlSWRlbnRpdHlQcm92aWRlclJlcXVlc3QaHS5ieXRlYmFzZS52MS5JZGVudGl0eVByb3ZpZGVyIoUB2kEdaWRlbnRpdHlfcHJvdmlkZXIsdXBkYXRlX21hc2uK6jAbYmIuaWRlbnRpdHlQcm92aWRlcnMudXBkYXRlkOowAZjqMAGC0+STAjg6EWlkZW50aXR5X3Byb3ZpZGVyMiMvdjEve2lkZW50aXR5X3Byb3ZpZGVyLm5hbWU9aWRwcy8qfRKlAQoWRGVsZXRlSWRlbnRpdHlQcm92aWRlchIqLmJ5dGViYXNlLnYxLkRlbGV0ZUlkZW50aXR5UHJvdmlkZXJSZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IkfaQQRuYW1liuowG2JiLmlkZW50aXR5UHJvdmlkZXJzLmRlbGV0ZZDqMAGY6jABgtPkkwITKhEvdjEve25hbWU9aWRwcy8qfRKqAQoUVGVzdElkZW50aXR5UHJvdmlkZXISKC5ieXRlYmFzZS52MS5UZXN0SWRlbnRpdHlQcm92aWRlclJlcXVlc3QaKS5ieXRlYmFzZS52MS5UZXN0SWRlbnRpdHlQcm92aWRlclJlc3BvbnNlIj2K6jAbYmIuaWRlbnRpdHlQcm92aWRlcnMudXBkYXRlkOowAYLT5JMCFDoBKiIPL3YxL2lkcHMvKjp0ZXN0QjRaMmdpdGh1Yi5jb20vYnl0ZWJhc2UvYnl0ZWJhc2UvcHJvdG8vZ2VuZXJhdGVkLWdvL3YxYgZwcm90bzM", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_field_mask, file_v1_annotation]);
/**
* Describes the message bytebase.v1.GetIdentityProviderRequest.
diff --git a/frontend/src/types/proto/v1/idp_service.ts b/frontend/src/types/proto/v1/idp_service.ts
index 3309bd3a58..463b67013d 100644
--- a/frontend/src/types/proto/v1/idp_service.ts
+++ b/frontend/src/types/proto/v1/idp_service.ts
@@ -221,6 +221,8 @@ export interface OAuth2IdentityProviderTestRequestContext {
export interface TestIdentityProviderResponse {
/** The map of claims returned by the identity provider. */
claims: { [key: string]: string };
+ /** The matched user info from the claims. */
+ userInfo: { [key: string]: string };
}
export interface TestIdentityProviderResponse_ClaimsEntry {
@@ -228,6 +230,11 @@ export interface TestIdentityProviderResponse_ClaimsEntry {
value: string;
}
+export interface TestIdentityProviderResponse_UserInfoEntry {
+ key: string;
+ value: string;
+}
+
export interface IdentityProvider {
/**
* The name of the identity provider.
@@ -980,7 +987,7 @@ export const OAuth2IdentityProviderTestRequestContext: MessageFns<OAuth2Identity
};
function createBaseTestIdentityProviderResponse(): TestIdentityProviderResponse {
- return { claims: {} };
+ return { claims: {}, userInfo: {} };
}
export const TestIdentityProviderResponse: MessageFns<TestIdentityProviderResponse> = {
@@ -988,6 +995,9 @@ export const TestIdentityProviderResponse: MessageFns<TestIdentityProviderRespon
Object.entries(message.claims).forEach(([key, value]) => {
TestIdentityProviderResponse_ClaimsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
});
+ Object.entries(message.userInfo).forEach(([key, value]) => {
+ TestIdentityProviderResponse_UserInfoEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
+ });
return writer;
},
@@ -1009,6 +1019,17 @@ export const TestIdentityProviderResponse: MessageFns<TestIdentityProviderRespon
}
continue;
}
+ case 2: {
+ if (tag !== 18) {
+ break;
+ }
+
+ const entry2 = TestIdentityProviderResponse_UserInfoEntry.decode(reader, reader.uint32());
+ if (entry2.value !== undefined) {
+ message.userInfo[entry2.key] = entry2.value;
+ }
+ continue;
+ }
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -1026,6 +1047,12 @@ export const TestIdentityProviderResponse: MessageFns<TestIdentityProviderRespon
return acc;
}, {})
: {},
+ userInfo: isObject(object.userInfo)
+ ? Object.entries(object.userInfo).reduce<{ [key: string]: string }>((acc, [key, value]) => {
+ acc[key] = String(value);
+ return acc;
+ }, {})
+ : {},
};
},
@@ -1040,6 +1067,15 @@ export const TestIdentityProviderResponse: MessageFns<TestIdentityProviderRespon
});
}
}
+ if (message.userInfo) {
+ const entries = Object.entries(message.userInfo);
+ if (entries.length > 0) {
+ obj.userInfo = {};
+ entries.forEach(([k, v]) => {
+ obj.userInfo[k] = v;
+ });
+ }
+ }
return obj;
},
@@ -1054,6 +1090,12 @@ export const TestIdentityProviderResponse: MessageFns<TestIdentityProviderRespon
}
return acc;
}, {});
+ message.userInfo = Object.entries(object.userInfo ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {
+ if (value !== undefined) {
+ acc[key] = globalThis.String(value);
+ }
+ return acc;
+ }, {});
return message;
},
};
@@ -1134,6 +1176,84 @@ export const TestIdentityProviderResponse_ClaimsEntry: MessageFns<TestIdentityPr
},
};
+function createBaseTestIdentityProviderResponse_UserInfoEntry(): TestIdentityProviderResponse_UserInfoEntry {
+ return { key: "", value: "" };
+}
+
+export const TestIdentityProviderResponse_UserInfoEntry: MessageFns<TestIdentityProviderResponse_UserInfoEntry> = {
+ encode(message: TestIdentityProviderResponse_UserInfoEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.key !== "") {
+ writer.uint32(10).string(message.key);
+ }
+ if (message.value !== "") {
+ writer.uint32(18).string(message.value);
+ }
+ return writer;
+ },
+
+ decode(input: BinaryReader | Uint8Array, length?: number): TestIdentityProviderResponse_UserInfoEntry {
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseTestIdentityProviderResponse_UserInfoEntry();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1: {
+ if (tag !== 10) {
+ break;
+ }
+
+ message.key = reader.string();
+ continue;
+ }
+ case 2: {
+ if (tag !== 18) {
+ break;
+ }
+
+ message.value = reader.string();
+ continue;
+ }
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skip(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): TestIdentityProviderResponse_UserInfoEntry {
+ return {
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
+ };
+ },
+
+ toJSON(message: TestIdentityProviderResponse_UserInfoEntry): unknown {
+ const obj: any = {};
+ if (message.key !== "") {
+ obj.key = message.key;
+ }
+ if (message.value !== "") {
+ obj.value = message.value;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<TestIdentityProviderResponse_UserInfoEntry>): TestIdentityProviderResponse_UserInfoEntry {
+ return TestIdentityProviderResponse_UserInfoEntry.fromPartial(base ?? {});
+ },
+ fromPartial(
+ object: DeepPartial<TestIdentityProviderResponse_UserInfoEntry>,
+ ): TestIdentityProviderResponse_UserInfoEntry {
+ const message = createBaseTestIdentityProviderResponse_UserInfoEntry();
+ message.key = object.key ?? "";
+ message.value = object.value ?? "";
+ return message;
+ },
+};
+
function createBaseIdentityProvider(): IdentityProvider {
return {
name: "",
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 6e1e137f41..70a82f63f9 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -13700,6 +13700,11 @@ components:
additionalProperties:
type: string
description: The map of claims returned by the identity provider.
+ userInfo:
+ type: object
+ additionalProperties:
+ type: string
+ description: The matched user info from the claims.
TestWebhookRequest:
required:
- project
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index bee91ad3a3..561849f622 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -382,6 +382,7 @@
- [TestIdentityProviderRequest](#bytebase-v1-TestIdentityProviderRequest)
- [TestIdentityProviderResponse](#bytebase-v1-TestIdentityProviderResponse)
- [TestIdentityProviderResponse.ClaimsEntry](#bytebase-v1-TestIdentityProviderResponse-ClaimsEntry)
+ - [TestIdentityProviderResponse.UserInfoEntry](#bytebase-v1-TestIdentityProviderResponse-UserInfoEntry)
- [UpdateIdentityProviderRequest](#bytebase-v1-UpdateIdentityProviderRequest)
- [IdentityProviderType](#bytebase-v1-IdentityProviderType)
@@ -6435,6 +6436,7 @@ OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| claims | [TestIdentityProviderResponse.ClaimsEntry](#bytebase-v1-TestIdentityProviderResponse-ClaimsEntry) | repeated | The map of claims returned by the identity provider. |
+| user_info | [TestIdentityProviderResponse.UserInfoEntry](#bytebase-v1-TestIdentityProviderResponse-UserInfoEntry) | repeated | The matched user info from the claims. |
@@ -6457,6 +6459,22 @@ OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
+<a name="bytebase-v1-TestIdentityProviderResponse-UserInfoEntry"></a>
+
+### TestIdentityProviderResponse.UserInfoEntry
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| key | [string](#string) | | |
+| value | [string](#string) | | |
+
+
+
+
+
+
<a name="bytebase-v1-UpdateIdentityProviderRequest"></a>
### UpdateIdentityProviderRequest
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 66b8dbc2cb..5bddcf7edc 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -1637,6 +1637,10 @@
<a href="#bytebase.v1.TestIdentityProviderResponse.ClaimsEntry"><span class="badge">M</span>TestIdentityProviderResponse.ClaimsEntry</a>
</li>
+ <li>
+ <a href="#bytebase.v1.TestIdentityProviderResponse.UserInfoEntry"><span class="badge">M</span>TestIdentityProviderResponse.UserInfoEntry</a>
+ </li>
+
<li>
<a href="#bytebase.v1.UpdateIdentityProviderRequest"><span class="badge">M</span>UpdateIdentityProviderRequest</a>
</li>
@@ -18096,6 +18100,13 @@ Should be fetched from the well-known configuration file of the OIDC provider. <
<td><p>The map of claims returned by the identity provider. </p></td>
</tr>
+ <tr>
+ <td>user_info</td>
+ <td><a href="#bytebase.v1.TestIdentityProviderResponse.UserInfoEntry">TestIdentityProviderResponse.UserInfoEntry</a></td>
+ <td>repeated</td>
+ <td><p>The matched user info from the claims. </p></td>
+ </tr>
+
</tbody>
</table>
@@ -18134,6 +18145,37 @@ Should be fetched from the well-known configuration file of the OIDC provider. <
+ <h3 id="bytebase.v1.TestIdentityProviderResponse.UserInfoEntry">TestIdentityProviderResponse.UserInfoEntry</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>key</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>value</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
<h3 id="bytebase.v1.UpdateIdentityProviderRequest">UpdateIdentityProviderRequest</h3>
<p></p>
diff --git a/proto/generated-go/v1/idp_service.pb.go b/proto/generated-go/v1/idp_service.pb.go
index 7e710d6426..129b7d7af1 100644
--- a/proto/generated-go/v1/idp_service.pb.go
+++ b/proto/generated-go/v1/idp_service.pb.go
@@ -633,7 +633,9 @@ func (x *OAuth2IdentityProviderTestRequestContext) GetCode() string {
type TestIdentityProviderResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The map of claims returned by the identity provider.
- Claims map[string]string `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ Claims map[string]string `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ // The matched user info from the claims.
+ UserInfo map[string]string `protobuf:"bytes,2,rep,name=user_info,json=userInfo,proto3" json:"user_info,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -675,6 +677,13 @@ func (x *TestIdentityProviderResponse) GetClaims() map[string]string {
return nil
}
+func (x *TestIdentityProviderResponse) GetUserInfo() map[string]string {
+ if x != nil {
+ return x.UserInfo
+ }
+ return nil
+}
+
type IdentityProvider struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The name of the identity provider.
@@ -1296,11 +1305,15 @@ const file_v1_idp_service_proto_rawDesc = "" +
"\x0eoauth2_context\x18\x02 \x01(\v25.bytebase.v1.OAuth2IdentityProviderTestRequestContextH\x00R\roauth2ContextB\t\n" +
"\acontext\">\n" +
"(OAuth2IdentityProviderTestRequestContext\x12\x12\n" +
- "\x04code\x18\x01 \x01(\tR\x04code\"\xa8\x01\n" +
+ "\x04code\x18\x01 \x01(\tR\x04code\"\xbb\x02\n" +
"\x1cTestIdentityProviderResponse\x12M\n" +
- "\x06claims\x18\x01 \x03(\v25.bytebase.v1.TestIdentityProviderResponse.ClaimsEntryR\x06claims\x1a9\n" +
+ "\x06claims\x18\x01 \x03(\v25.bytebase.v1.TestIdentityProviderResponse.ClaimsEntryR\x06claims\x12T\n" +
+ "\tuser_info\x18\x02 \x03(\v27.bytebase.v1.TestIdentityProviderResponse.UserInfoEntryR\buserInfo\x1a9\n" +
"\vClaimsEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
+ "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a;\n" +
+ "\rUserInfoEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xf1\x01\n" +
"\x10IdentityProvider\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" +
@@ -1392,7 +1405,7 @@ func file_v1_idp_service_proto_rawDescGZIP() []byte {
}
var file_v1_idp_service_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
-var file_v1_idp_service_proto_msgTypes = make([]protoimpl.MessageInfo, 16)
+var file_v1_idp_service_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
var file_v1_idp_service_proto_goTypes = []any{
(IdentityProviderType)(0), // 0: bytebase.v1.IdentityProviderType
(OAuth2AuthStyle)(0), // 1: bytebase.v1.OAuth2AuthStyle
@@ -1413,45 +1426,47 @@ var file_v1_idp_service_proto_goTypes = []any{
(*LDAPIdentityProviderConfig)(nil), // 16: bytebase.v1.LDAPIdentityProviderConfig
(*FieldMapping)(nil), // 17: bytebase.v1.FieldMapping
nil, // 18: bytebase.v1.TestIdentityProviderResponse.ClaimsEntry
- (*fieldmaskpb.FieldMask)(nil), // 19: google.protobuf.FieldMask
- (*emptypb.Empty)(nil), // 20: google.protobuf.Empty
+ nil, // 19: bytebase.v1.TestIdentityProviderResponse.UserInfoEntry
+ (*fieldmaskpb.FieldMask)(nil), // 20: google.protobuf.FieldMask
+ (*emptypb.Empty)(nil), // 21: google.protobuf.Empty
}
var file_v1_idp_service_proto_depIdxs = []int32{
12, // 0: bytebase.v1.ListIdentityProvidersResponse.identity_providers:type_name -> bytebase.v1.IdentityProvider
12, // 1: bytebase.v1.CreateIdentityProviderRequest.identity_provider:type_name -> bytebase.v1.IdentityProvider
12, // 2: bytebase.v1.UpdateIdentityProviderRequest.identity_provider:type_name -> bytebase.v1.IdentityProvider
- 19, // 3: bytebase.v1.UpdateIdentityProviderRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 20, // 3: bytebase.v1.UpdateIdentityProviderRequest.update_mask:type_name -> google.protobuf.FieldMask
12, // 4: bytebase.v1.TestIdentityProviderRequest.identity_provider:type_name -> bytebase.v1.IdentityProvider
10, // 5: bytebase.v1.TestIdentityProviderRequest.oauth2_context:type_name -> bytebase.v1.OAuth2IdentityProviderTestRequestContext
18, // 6: bytebase.v1.TestIdentityProviderResponse.claims:type_name -> bytebase.v1.TestIdentityProviderResponse.ClaimsEntry
- 0, // 7: bytebase.v1.IdentityProvider.type:type_name -> bytebase.v1.IdentityProviderType
- 13, // 8: bytebase.v1.IdentityProvider.config:type_name -> bytebase.v1.IdentityProviderConfig
- 14, // 9: bytebase.v1.IdentityProviderConfig.oauth2_config:type_name -> bytebase.v1.OAuth2IdentityProviderConfig
- 15, // 10: bytebase.v1.IdentityProviderConfig.oidc_config:type_name -> bytebase.v1.OIDCIdentityProviderConfig
- 16, // 11: bytebase.v1.IdentityProviderConfig.ldap_config:type_name -> bytebase.v1.LDAPIdentityProviderConfig
- 17, // 12: bytebase.v1.OAuth2IdentityProviderConfig.field_mapping:type_name -> bytebase.v1.FieldMapping
- 1, // 13: bytebase.v1.OAuth2IdentityProviderConfig.auth_style:type_name -> bytebase.v1.OAuth2AuthStyle
- 17, // 14: bytebase.v1.OIDCIdentityProviderConfig.field_mapping:type_name -> bytebase.v1.FieldMapping
- 1, // 15: bytebase.v1.OIDCIdentityProviderConfig.auth_style:type_name -> bytebase.v1.OAuth2AuthStyle
- 2, // 16: bytebase.v1.LDAPIdentityProviderConfig.security_protocol:type_name -> bytebase.v1.LDAPIdentityProviderConfig.SecurityProtocol
- 17, // 17: bytebase.v1.LDAPIdentityProviderConfig.field_mapping:type_name -> bytebase.v1.FieldMapping
- 3, // 18: bytebase.v1.IdentityProviderService.GetIdentityProvider:input_type -> bytebase.v1.GetIdentityProviderRequest
- 4, // 19: bytebase.v1.IdentityProviderService.ListIdentityProviders:input_type -> bytebase.v1.ListIdentityProvidersRequest
- 6, // 20: bytebase.v1.IdentityProviderService.CreateIdentityProvider:input_type -> bytebase.v1.CreateIdentityProviderRequest
- 7, // 21: bytebase.v1.IdentityProviderService.UpdateIdentityProvider:input_type -> bytebase.v1.UpdateIdentityProviderRequest
- 8, // 22: bytebase.v1.IdentityProviderService.DeleteIdentityProvider:input_type -> bytebase.v1.DeleteIdentityProviderRequest
- 9, // 23: bytebase.v1.IdentityProviderService.TestIdentityProvider:input_type -> bytebase.v1.TestIdentityProviderRequest
- 12, // 24: bytebase.v1.IdentityProviderService.GetIdentityProvider:output_type -> bytebase.v1.IdentityProvider
- 5, // 25: bytebase.v1.IdentityProviderService.ListIdentityProviders:output_type -> bytebase.v1.ListIdentityProvidersResponse
- 12, // 26: bytebase.v1.IdentityProviderService.CreateIdentityProvider:output_type -> bytebase.v1.IdentityProvider
- 12, // 27: bytebase.v1.IdentityProviderService.UpdateIdentityProvider:output_type -> bytebase.v1.IdentityProvider
- 20, // 28: bytebase.v1.IdentityProviderService.DeleteIdentityProvider:output_type -> google.protobuf.Empty
- 11, // 29: bytebase.v1.IdentityProviderService.TestIdentityProvider:output_type -> bytebase.v1.TestIdentityProviderResponse
- 24, // [24:30] is the sub-list for method output_type
- 18, // [18:24] is the sub-list for method input_type
- 18, // [18:18] is the sub-list for extension type_name
- 18, // [18:18] is the sub-list for extension extendee
- 0, // [0:18] is the sub-list for field type_name
+ 19, // 7: bytebase.v1.TestIdentityProviderResponse.user_info:type_name -> bytebase.v1.TestIdentityProviderResponse.UserInfoEntry
+ 0, // 8: bytebase.v1.IdentityProvider.type:type_name -> bytebase.v1.IdentityProviderType
+ 13, // 9: bytebase.v1.IdentityProvider.config:type_name -> bytebase.v1.IdentityProviderConfig
+ 14, // 10: bytebase.v1.IdentityProviderConfig.oauth2_config:type_name -> bytebase.v1.OAuth2IdentityProviderConfig
+ 15, // 11: bytebase.v1.IdentityProviderConfig.oidc_config:type_name -> bytebase.v1.OIDCIdentityProviderConfig
+ 16, // 12: bytebase.v1.IdentityProviderConfig.ldap_config:type_name -> bytebase.v1.LDAPIdentityProviderConfig
+ 17, // 13: bytebase.v1.OAuth2IdentityProviderConfig.field_mapping:type_name -> bytebase.v1.FieldMapping
+ 1, // 14: bytebase.v1.OAuth2IdentityProviderConfig.auth_style:type_name -> bytebase.v1.OAuth2AuthStyle
+ 17, // 15: bytebase.v1.OIDCIdentityProviderConfig.field_mapping:type_name -> bytebase.v1.FieldMapping
+ 1, // 16: bytebase.v1.OIDCIdentityProviderConfig.auth_style:type_name -> bytebase.v1.OAuth2AuthStyle
+ 2, // 17: bytebase.v1.LDAPIdentityProviderConfig.security_protocol:type_name -> bytebase.v1.LDAPIdentityProviderConfig.SecurityProtocol
+ 17, // 18: bytebase.v1.LDAPIdentityProviderConfig.field_mapping:type_name -> bytebase.v1.FieldMapping
+ 3, // 19: bytebase.v1.IdentityProviderService.GetIdentityProvider:input_type -> bytebase.v1.GetIdentityProviderRequest
+ 4, // 20: bytebase.v1.IdentityProviderService.ListIdentityProviders:input_type -> bytebase.v1.ListIdentityProvidersRequest
+ 6, // 21: bytebase.v1.IdentityProviderService.CreateIdentityProvider:input_type -> bytebase.v1.CreateIdentityProviderRequest
+ 7, // 22: bytebase.v1.IdentityProviderService.UpdateIdentityProvider:input_type -> bytebase.v1.UpdateIdentityProviderRequest
+ 8, // 23: bytebase.v1.IdentityProviderService.DeleteIdentityProvider:input_type -> bytebase.v1.DeleteIdentityProviderRequest
+ 9, // 24: bytebase.v1.IdentityProviderService.TestIdentityProvider:input_type -> bytebase.v1.TestIdentityProviderRequest
+ 12, // 25: bytebase.v1.IdentityProviderService.GetIdentityProvider:output_type -> bytebase.v1.IdentityProvider
+ 5, // 26: bytebase.v1.IdentityProviderService.ListIdentityProviders:output_type -> bytebase.v1.ListIdentityProvidersResponse
+ 12, // 27: bytebase.v1.IdentityProviderService.CreateIdentityProvider:output_type -> bytebase.v1.IdentityProvider
+ 12, // 28: bytebase.v1.IdentityProviderService.UpdateIdentityProvider:output_type -> bytebase.v1.IdentityProvider
+ 21, // 29: bytebase.v1.IdentityProviderService.DeleteIdentityProvider:output_type -> google.protobuf.Empty
+ 11, // 30: bytebase.v1.IdentityProviderService.TestIdentityProvider:output_type -> bytebase.v1.TestIdentityProviderResponse
+ 25, // [25:31] is the sub-list for method output_type
+ 19, // [19:25] is the sub-list for method input_type
+ 19, // [19:19] is the sub-list for extension type_name
+ 19, // [19:19] is the sub-list for extension extendee
+ 0, // [0:19] is the sub-list for field type_name
}
func init() { file_v1_idp_service_proto_init() }
@@ -1474,7 +1489,7 @@ func file_v1_idp_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_idp_service_proto_rawDesc), len(file_v1_idp_service_proto_rawDesc)),
NumEnums: 3,
- NumMessages: 16,
+ NumMessages: 17,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/proto/v1/v1/idp_service.proto b/proto/v1/v1/idp_service.proto
index d97ecd9835..a35ef77deb 100644
--- a/proto/v1/v1/idp_service.proto
+++ b/proto/v1/v1/idp_service.proto
@@ -152,6 +152,8 @@ message OAuth2IdentityProviderTestRequestContext {
message TestIdentityProviderResponse {
// The map of claims returned by the identity provider.
map<string, string> claims = 1;
+ // The matched user info from the claims.
+ map<string, string> user_info = 2;
}
message IdentityProvider {