Skip to content

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

feat: return MFA temp token when MFA enabled (#5059)

boojack134ea063d0cc
diff --git a/backend/api/auth/auth.go b/backend/api/auth/auth.go
index b1be514ec1..e767b30194 100644
--- a/backend/api/auth/auth.go
+++ b/backend/api/auth/auth.go
@@ -32,6 +32,8 @@ const (
AccessTokenAudienceFmt = "bb.user.access.%s"
// RefreshTokenAudienceFmt is the format of the refresh token audience.
RefreshTokenAudienceFmt = "bb.user.refresh.%s"
+ // MFATempTokenAudienceFmt is the format of the MFA temp token audience.
+ MFATempTokenAudienceFmt = "bb.user.mfa-temp.%s"
apiTokenDuration = 2 * time.Hour
accessTokenDuration = 24 * time.Hour
refreshTokenDuration = 7 * 24 * time.Hour
@@ -206,6 +208,33 @@ func (in *APIAuthInterceptor) authenticate(ctx context.Context, accessTokenStr,
return principalID, nil
}
+// GetUserIDFromMFATempToken returns the user ID from the MFA temp token.
+func GetUserIDFromMFATempToken(token string, mode common.ReleaseMode, secret string) (int, error) {
+ claims := &claimsMessage{}
+ _, err := jwt.ParseWithClaims(token, claims, func(t *jwt.Token) (interface{}, error) {
+ if t.Method.Alg() != jwt.SigningMethodHS256.Name {
+ return nil, status.Errorf(codes.Unauthenticated, "unexpected MFA temp token signing method=%v, expect %v", t.Header["alg"], jwt.SigningMethodHS256)
+ }
+ if kid, ok := t.Header["kid"].(string); ok {
+ if kid == "v1" {
+ return []byte(secret), nil
+ }
+ }
+ return nil, status.Errorf(codes.Unauthenticated, "unexpected MFA temp token kid=%v", t.Header["kid"])
+ })
+ if err != nil {
+ return 0, status.Errorf(codes.Unauthenticated, "failed to parse claim")
+ }
+ if !audienceContains(claims.Audience, fmt.Sprintf(MFATempTokenAudienceFmt, mode)) {
+ return 0, status.Errorf(codes.Unauthenticated, "invalid MFA temp token, audience mismatch")
+ }
+ userID, err := strconv.Atoi(claims.Subject)
+ if err != nil {
+ return 0, status.Errorf(codes.Unauthenticated, "malformed ID %q in the MFA temp token", claims.Subject)
+ }
+ return userID, nil
+}
+
func getTokenFromMetadata(md metadata.MD) (string, string, error) {
authorizationHeaders := md.Get("Authorization")
if len(md.Get("Authorization")) > 0 {
@@ -288,6 +317,12 @@ func GenerateRefreshToken(userName string, userID int, mode common.ReleaseMode,
return generateToken(userName, userID, fmt.Sprintf(RefreshTokenAudienceFmt, mode), expirationTime, []byte(secret))
}
+// GenerateMFATempToken generates a temporary token for MFA.
+func GenerateMFATempToken(userName string, userID int, mode common.ReleaseMode, secret string) (string, error) {
+ expirationTime := time.Now().Add(accessTokenDuration)
+ return generateToken(userName, userID, fmt.Sprintf(MFATempTokenAudienceFmt, mode), expirationTime, []byte(secret))
+}
+
// Pay attention to this function. It holds the main JWT token generation logic.
func generateToken(userName string, userID int, aud string, expirationTime time.Time, secret []byte) (string, error) {
// Create the JWT claims, which includes the username and expiry time.
diff --git a/backend/api/v1/auth_service.go b/backend/api/v1/auth_service.go
index 1195091e09..c0f51c07a1 100644
--- a/backend/api/v1/auth_service.go
+++ b/backend/api/v1/auth_service.go
@@ -478,15 +478,48 @@ func convertUserRole(userRole v1pb.UserRole) api.Role {
// Login is the auth login method including SSO.
func (s *AuthService) Login(ctx context.Context, request *v1pb.LoginRequest) (*v1pb.LoginResponse, error) {
var loginUser *store.UserMessage
- var err error
- if request.IdpName == "" {
- loginUser, err = s.getAndVerifyUser(ctx, request)
- } else {
- loginUser, err = s.getOrCreateUserWithIDP(ctx, request)
+ mfaSecondLogin := false
+ if request.MfaTempToken != nil && *request.MfaTempToken != "" {
+ mfaSecondLogin = true
}
- if err != nil {
- return nil, err
+
+ if !mfaSecondLogin {
+ var err error
+ if request.IdpName == "" {
+ loginUser, err = s.getAndVerifyUser(ctx, request)
+ } else {
+ loginUser, err = s.getOrCreateUserWithIDP(ctx, request)
+ }
+ if err != nil {
+ return nil, err
+ }
+ } else {
+ userID, err := auth.GetUserIDFromMFATempToken(*request.MfaTempToken, s.profile.Mode, s.secret)
+ if err != nil {
+ return nil, err
+ }
+ user, err := s.store.GetUserByID(ctx, userID)
+ if err != nil {
+ return nil, err
+ }
+ if user == nil {
+ return nil, status.Errorf(codes.Unauthenticated, "user not found")
+ }
+
+ if request.OtpCode != nil {
+ if err := challengeMFACode(user, *request.OtpCode); err != nil {
+ return nil, err
+ }
+ } else if request.RecoveryCode != nil {
+ if err := s.challengeRecoveryCode(ctx, user, *request.RecoveryCode); err != nil {
+ return nil, err
+ }
+ } else {
+ return nil, status.Errorf(codes.Unauthenticated, "OTP or recovery code is required for MFA")
+ }
+ loginUser = user
}
+
if loginUser == nil {
return nil, status.Errorf(codes.Unauthenticated, "login user not found")
}
@@ -494,35 +527,42 @@ func (s *AuthService) Login(ctx context.Context, request *v1pb.LoginRequest) (*v
return nil, status.Errorf(codes.Unauthenticated, "user has been deactivated by administrators")
}
- if s.licenseService.IsFeatureEnabled(api.Feature2FA) {
- if loginUser.MFAConfig != nil && loginUser.MFAConfig.OtpSecret != "" {
- if request.OtpCode != nil {
- if err := challengeMFACode(loginUser, *request.OtpCode); err != nil {
- return nil, err
- }
- } else if request.RecoveryCode != nil {
- if err := s.challengeRecoveryCode(ctx, loginUser, *request.RecoveryCode); err != nil {
- return nil, err
- }
- } else {
- // Return FailedPrecondition error to indicate MFA is required.
- return nil, status.Errorf(codes.FailedPrecondition, "MFA is required")
- }
+ userMFAEnabled := loginUser.MFAConfig != nil && loginUser.MFAConfig.OtpSecret != ""
+ // We only allow MFA login (2-step) when the feature is enabled and user has enabled MFA.
+ if s.licenseService.IsFeatureEnabled(api.Feature2FA) && !mfaSecondLogin && userMFAEnabled {
+ mfaTempToken, err := auth.GenerateMFATempToken(loginUser.Name, loginUser.ID, s.profile.Mode, s.secret)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to generate MFA temp token")
}
+ return &v1pb.LoginResponse{
+ MfaTempToken: &mfaTempToken,
+ }, nil
}
- var accessToken string
- if request.Web {
+ var accessToken, refreshToken string
+ if loginUser.Type == api.EndUser {
token, err := auth.GenerateAccessToken(loginUser.Name, loginUser.ID, s.profile.Mode, s.secret)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to generate API access token")
}
accessToken = token
- refreshToken, err := auth.GenerateRefreshToken(loginUser.Name, loginUser.ID, s.profile.Mode, s.secret)
+ if request.Web {
+ refreshToken, err = auth.GenerateRefreshToken(loginUser.Name, loginUser.ID, s.profile.Mode, s.secret)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to generate API access token")
+ }
+ }
+ } else if loginUser.Type == api.ServiceAccount {
+ token, err := auth.GenerateAPIToken(loginUser.Name, loginUser.ID, s.profile.Mode, s.secret)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to generate API access token")
}
+ accessToken = token
+ } else {
+ return nil, status.Errorf(codes.Unauthenticated, fmt.Sprintf("user type %s cannot login", loginUser.Type))
+ }
+ if request.Web {
if err := grpc.SetHeader(ctx, metadata.New(map[string]string{
auth.GatewayMetadataAccessTokenKey: accessToken,
auth.GatewayMetadataRefreshTokenKey: refreshToken,
@@ -530,12 +570,6 @@ func (s *AuthService) Login(ctx context.Context, request *v1pb.LoginRequest) (*v
})); err != nil {
return nil, status.Errorf(codes.Internal, "failed to set grpc header, error: %v", err)
}
- } else {
- token, err := auth.GenerateAPIToken(loginUser.Name, loginUser.ID, s.profile.Mode, s.secret)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to generate API access token")
- }
- accessToken = token
}
return &v1pb.LoginResponse{
Token: accessToken,
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index 616812a7fa..4d8f5ae4b4 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -76,7 +76,11 @@ axios.interceptors.response.use(
// in such case, we shouldn't logout.
if (error.response.status == 401) {
const origin = location.origin;
- if (error.response.request.responseURL.startsWith(origin)) {
+ const pathname = location.pathname;
+ if (
+ pathname !== "/auth/mfa" &&
+ error.response.request.responseURL.startsWith(origin)
+ ) {
// If the request URL starts with the browser's location origin
// e.g. http://localhost:3000/
// we know this is a request to Bytebase API endpoint (not an external service).
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index 4e444655bf..5bee562d14 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -29,6 +29,7 @@ import {
} from "../utils";
import Signin from "../views/auth/Signin.vue";
import Signup from "../views/auth/Signup.vue";
+import MultiFactor from "../views/auth/MultiFactor.vue";
import DashboardSidebar from "../views/DashboardSidebar.vue";
import Home from "../views/Home.vue";
import {
@@ -58,6 +59,7 @@ const HOME_MODULE = "workspace.home";
const AUTH_MODULE = "auth";
const SIGNIN_MODULE = "auth.signin";
const SIGNUP_MODULE = "auth.signup";
+const MFA_MODULE = "auth.mfa";
const ACTIVATE_MODULE = "auth.activate";
const PASSWORD_RESET_MODULE = "auth.password.reset";
const PASSWORD_FORGOT_MODULE = "auth.password.forgot";
@@ -108,6 +110,13 @@ const routes: Array<RouteRecordRaw> = [
},
],
},
+ {
+ path: "/auth/mfa",
+ name: MFA_MODULE,
+ meta: { title: () => t("multi-factor.self") },
+ component: MultiFactor,
+ props: true,
+ },
{
path: "/oauth/callback",
name: "oauth-callback",
@@ -1014,6 +1023,7 @@ router.beforeEach((to, from, next) => {
if (
to.name === SIGNIN_MODULE ||
to.name === SIGNUP_MODULE ||
+ to.name === MFA_MODULE ||
to.name === ACTIVATE_MODULE ||
to.name === PASSWORD_RESET_MODULE ||
to.name === PASSWORD_FORGOT_MODULE
diff --git a/frontend/src/store/modules/auth.ts b/frontend/src/store/modules/auth.ts
index a53163aac0..cc0f67dd44 100644
--- a/frontend/src/store/modules/auth.ts
+++ b/frontend/src/store/modules/auth.ts
@@ -5,7 +5,12 @@ import { computed } from "vue";
import { SignupInfo, ActivateInfo } from "@/types";
import { getIntCookie } from "@/utils";
import { authServiceClient } from "@/grpcweb";
-import { LoginRequest, User, UserType } from "@/types/proto/v1/auth_service";
+import {
+ LoginRequest,
+ LoginResponse,
+ User,
+ UserType,
+} from "@/types/proto/v1/auth_service";
import { convertUserToPrincipal, useUserStore } from ".";
import { unknown } from "@/utils/common";
@@ -22,14 +27,18 @@ export const useAuthStore = defineStore("auth_v1", {
return getIntCookie("user") != undefined;
},
async login(request: Partial<LoginRequest>) {
- await axios.post("/v1/auth/login", request);
+ const {
+ data: { mfaTempToken },
+ } = await axios.post<LoginResponse>("/v1/auth/login", request);
+ if (mfaTempToken) {
+ return mfaTempToken;
+ }
+
const userId = getIntCookie("user");
if (userId) {
const loggedInUser = await useUserStore().getOrFetchUserById(userId);
this.currentUser = loggedInUser;
- return loggedInUser;
}
- return unknown("USER");
},
async signup(signupInfo: SignupInfo) {
await authServiceClient.createUser({
@@ -40,12 +49,11 @@ export const useAuthStore = defineStore("auth_v1", {
userType: UserType.USER,
},
});
- const user = await this.login({
+ await this.login({
email: signupInfo.email,
password: signupInfo.password,
web: true,
});
- return user;
},
async logout() {
const unknownUser = unknown("USER");
diff --git a/frontend/src/types/mfa.ts b/frontend/src/types/mfa.ts
index 3ac57ecae5..e69de29bb2 100644
--- a/frontend/src/types/mfa.ts
+++ b/frontend/src/types/mfa.ts
@@ -1,6 +0,0 @@
-export interface MFAChallengeContext {
- otpCode?: string;
- recoveryCode?: string;
-}
-
-export type MFAChallengeCallback = (context: MFAChallengeContext) => any;
diff --git a/frontend/src/types/proto/v1/auth_service.ts b/frontend/src/types/proto/v1/auth_service.ts
index 942554f4d4..3ebe501270 100644
--- a/frontend/src/types/proto/v1/auth_service.ts
+++ b/frontend/src/types/proto/v1/auth_service.ts
@@ -196,7 +196,11 @@ export interface LoginRequest {
| string
| undefined;
/** The recovery_code is used to recovery the user's identity with MFA. */
- recoveryCode?: string | undefined;
+ recoveryCode?:
+ | string
+ | undefined;
+ /** The mfa_temp_token is used to verify the user's identity by MFA. */
+ mfaTempToken?: string | undefined;
}
export interface IdentityProviderContext {
@@ -213,6 +217,7 @@ export interface OIDCIdentityProviderContext {
export interface LoginResponse {
token: string;
+ mfaTempToken?: string | undefined;
}
export interface LogoutRequest {
@@ -657,6 +662,7 @@ function createBaseLoginRequest(): LoginRequest {
idpContext: undefined,
otpCode: undefined,
recoveryCode: undefined,
+ mfaTempToken: undefined,
};
}
@@ -683,6 +689,9 @@ export const LoginRequest = {
if (message.recoveryCode !== undefined) {
writer.uint32(58).string(message.recoveryCode);
}
+ if (message.mfaTempToken !== undefined) {
+ writer.uint32(66).string(message.mfaTempToken);
+ }
return writer;
},
@@ -714,6 +723,9 @@ export const LoginRequest = {
case 7:
message.recoveryCode = reader.string();
break;
+ case 8:
+ message.mfaTempToken = reader.string();
+ break;
default:
reader.skipType(tag & 7);
break;
@@ -731,6 +743,7 @@ export const LoginRequest = {
idpContext: isSet(object.idpContext) ? IdentityProviderContext.fromJSON(object.idpContext) : undefined,
otpCode: isSet(object.otpCode) ? String(object.otpCode) : undefined,
recoveryCode: isSet(object.recoveryCode) ? String(object.recoveryCode) : undefined,
+ mfaTempToken: isSet(object.mfaTempToken) ? String(object.mfaTempToken) : undefined,
};
},
@@ -744,6 +757,7 @@ export const LoginRequest = {
(obj.idpContext = message.idpContext ? IdentityProviderContext.toJSON(message.idpContext) : undefined);
message.otpCode !== undefined && (obj.otpCode = message.otpCode);
message.recoveryCode !== undefined && (obj.recoveryCode = message.recoveryCode);
+ message.mfaTempToken !== undefined && (obj.mfaTempToken = message.mfaTempToken);
return obj;
},
@@ -758,6 +772,7 @@ export const LoginRequest = {
: undefined;
message.otpCode = object.otpCode ?? undefined;
message.recoveryCode = object.recoveryCode ?? undefined;
+ message.mfaTempToken = object.mfaTempToken ?? undefined;
return message;
},
};
@@ -916,7 +931,7 @@ export const OIDCIdentityProviderContext = {
};
function createBaseLoginResponse(): LoginResponse {
- return { token: "" };
+ return { token: "", mfaTempToken: undefined };
}
export const LoginResponse = {
@@ -924,6 +939,9 @@ export const LoginResponse = {
if (message.token !== "") {
writer.uint32(10).string(message.token);
}
+ if (message.mfaTempToken !== undefined) {
+ writer.uint32(18).string(message.mfaTempToken);
+ }
return writer;
},
@@ -937,6 +955,9 @@ export const LoginResponse = {
case 1:
message.token = reader.string();
break;
+ case 2:
+ message.mfaTempToken = reader.string();
+ break;
default:
reader.skipType(tag & 7);
break;
@@ -946,18 +967,23 @@ export const LoginResponse = {
},
fromJSON(object: any): LoginResponse {
- return { token: isSet(object.token) ? String(object.token) : "" };
+ return {
+ token: isSet(object.token) ? String(object.token) : "",
+ mfaTempToken: isSet(object.mfaTempToken) ? String(object.mfaTempToken) : undefined,
+ };
},
toJSON(message: LoginResponse): unknown {
const obj: any = {};
message.token !== undefined && (obj.token = message.token);
+ message.mfaTempToken !== undefined && (obj.mfaTempToken = message.mfaTempToken);
return obj;
},
fromPartial(object: DeepPartial<LoginResponse>): LoginResponse {
const message = createBaseLoginResponse();
message.token = object.token ?? "";
+ message.mfaTempToken = object.mfaTempToken ?? undefined;
return message;
},
};
diff --git a/frontend/src/components/MFAChallengeModal.vue b/frontend/src/views/auth/MultiFactor.vue
similarity index 69%
rename from frontend/src/components/MFAChallengeModal.vue
rename to frontend/src/views/auth/MultiFactor.vue
index 509cba9ec4..fea5e9e4d3 100644
--- a/frontend/src/components/MFAChallengeModal.vue
+++ b/frontend/src/views/auth/MultiFactor.vue
@@ -1,7 +1,17 @@
<template>
- <BBModal :title="modalTitle" :show-close="false">
- <div class="w-72">
- <div class="w-full mt-4 h-auto flex flex-col justify-start items-center">
+ <div
+ class="mx-auto w-full h-full min-h-screen flex flex-col justify-center items-center bg-gray-100"
+ >
+ <img
+ class="h-12 w-auto mx-auto -mt-16 mb-4"
+ src="../../assets/logo-full.svg"
+ alt="Bytebase"
+ />
+ <div class="w-80 bg-white p-8 py-6 rounded-lg shadow">
+ <form
+ class="w-full mt-4 h-auto flex flex-col justify-start items-center"
+ @submit.prevent="challenge"
+ >
<template v-if="state.selectedMFAType === 'OTP'">
<heroicons-outline:device-phone-mobile class="w-8 h-auto" />
<p class="my-2 mb-4">{{ $t("multi-factor.auth-code") }}</p>
@@ -22,13 +32,13 @@
type="text"
/>
</template>
- <button class="btn-success w-full mt-4" @click="challenge">
+ <button type="submit" class="btn-success w-full mt-4">
<span class="w-full text-center">{{ $t("common.verify") }}</span>
</button>
<p class="textinfolabel mt-2">
{{ challengeDescription }}
</p>
- </div>
+ </form>
<hr class="my-3" />
<div class="text-sm mb-2">
<p class="">{{ $t("multi-factor.other-methods.self") }}:</p>
@@ -49,12 +59,14 @@
</ul>
</div>
</div>
- </BBModal>
+ </div>
</template>
<script lang="ts" setup>
+import { useAuthStore } from "@/store";
import { computed, reactive } from "vue";
import { useI18n } from "vue-i18n";
+import { useRoute, useRouter } from "vue-router";
type MFAType = "OTP" | "RECOVERY_CODE";
@@ -64,27 +76,23 @@ interface LocalState {
recoveryCode: string;
}
-const props = defineProps({
- title: {
- type: String,
- default: "",
- },
- challengeCallback: {
- type: Function,
- required: true,
- },
-});
-
const { t } = useI18n();
+const route = useRoute();
+const router = useRouter();
+const authStore = useAuthStore();
const state = reactive<LocalState>({
selectedMFAType: "OTP",
otpCode: "",
recoveryCode: "",
});
-const modalTitle = computed(() => {
- return props.title ? props.title : t("multi-factor.self");
+const mfaTempToken = computed(() => {
+ return String(route.query.mfaTempToken);
});
+const redirectUrl = computed(() => {
+ return String(route.query.redirect) || "/";
+});
+
const challengeDescription = computed(() => {
if (state.selectedMFAType === "OTP") {
return t("multi-factor.other-methods.use-auth-app.description");
@@ -96,14 +104,17 @@ const challengeDescription = computed(() => {
});
const challenge = async () => {
+ const mfaContext: any = {};
if (state.selectedMFAType === "OTP") {
- await props.challengeCallback({
- otpCode: state.otpCode,
- });
+ mfaContext.otpCode = state.otpCode;
} else if (state.selectedMFAType === "RECOVERY_CODE") {
- await props.challengeCallback({
- recoveryCode: state.recoveryCode,
- });
+ mfaContext.recoveryCode = state.recoveryCode;
}
+ await authStore.login({
+ web: true,
+ mfaTempToken: mfaTempToken.value,
+ ...mfaContext,
+ });
+ router.replace(redirectUrl.value);
};
</script>
diff --git a/frontend/src/views/auth/Signin.vue b/frontend/src/views/auth/Signin.vue
index 781701cb63..d3d32a7d12 100644
--- a/frontend/src/views/auth/Signin.vue
+++ b/frontend/src/views/auth/Signin.vue
@@ -142,22 +142,13 @@
</div>
</div>
<AuthFooter />
-
- <MFAChallengeModal
- v-if="state.showMFAChallengeModal"
- :challenge-callback="state.mfaChallengeCallback"
- />
</template>
<script lang="ts" setup>
import { computed, onMounted, onUnmounted, reactive, watch } from "vue";
import { useRouter } from "vue-router";
import { storeToRefs } from "pinia";
-import {
- MFAChallengeCallback,
- MFAChallengeContext,
- OAuthWindowEventPayload,
-} from "@/types";
+import { OAuthWindowEventPayload } from "@/types";
import { isValidEmail, openWindowForSSO } from "@/utils";
import {
featureToRef,
@@ -170,16 +161,12 @@ import {
IdentityProviderType,
} from "@/types/proto/v1/idp_service";
import AuthFooter from "./AuthFooter.vue";
-import MFAChallengeModal from "@/components/MFAChallengeModal.vue";
-import { Status } from "nice-grpc-common";
interface LocalState {
email: string;
password: string;
showPassword: boolean;
activeIdentityProvider?: IdentityProvider;
- showMFAChallengeModal: boolean;
- mfaChallengeCallback: MFAChallengeCallback;
}
const actuatorStore = useActuatorStore();
@@ -191,8 +178,6 @@ const state = reactive<LocalState>({
email: "",
password: "",
showPassword: false,
- showMFAChallengeModal: false,
- mfaChallengeCallback: (_: MFAChallengeContext) => undefined,
});
const { isDemo, disallowSignup } = storeToRefs(actuatorStore);
const hasSSOFeature = featureToRef("bb.feature.sso");
@@ -263,7 +248,7 @@ const loginWithIdentityProviderEventListener = async (event: Event) => {
return;
}
- const signinContext = {
+ const mfaTempToken = await authStore.login({
idpName: state.activeIdentityProvider.name,
idpContext: {
oauth2Context: {
@@ -271,23 +256,17 @@ const loginWithIdentityProviderEventListener = async (event: Event) => {
},
},
web: true,
- };
- try {
- await authStore.login({
- ...signinContext,
+ });
+ if (mfaTempToken) {
+ router.push({
+ name: "auth.mfa",
+ query: {
+ mfaTempToken,
+ redirect: "",
+ },
});
+ } else {
router.push("/");
- } catch (error: any) {
- if (error.response.data.code === Status.FAILED_PRECONDITION) {
- state.showMFAChallengeModal = true;
- state.mfaChallengeCallback = async (mfaContext) => {
- await authStore.login({
- ...signinContext,
- ...mfaContext,
- });
- router.push("/");
- };
- }
}
}
};
@@ -297,27 +276,21 @@ const allowSignin = computed(() => {
});
const trySignin = async () => {
- const signinContext = {
+ const mfaTempToken = await authStore.login({
email: state.email,
password: state.password,
web: true,
- };
- try {
- await authStore.login({
- ...signinContext,
+ });
+ if (mfaTempToken) {
+ router.push({
+ name: "auth.mfa",
+ query: {
+ mfaTempToken,
+ redirect: "",
+ },
});
+ } else {
router.push("/");
- } catch (error: any) {
- if (error.response.data.code === Status.FAILED_PRECONDITION) {
- state.showMFAChallengeModal = true;
- state.mfaChallengeCallback = async (mfaContext) => {
- await authStore.login({
- ...signinContext,
- ...mfaContext,
- });
- router.push("/");
- };
- }
}
};
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 35b5e009dd..4834772041 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -733,6 +733,7 @@ When paginating, all other parameters provided to `ListUsers` must match the cal
| idp_context | [IdentityProviderContext](#bytebase-v1-IdentityProviderContext) | | The idp_context is using to get the user information from identity provider. |
| otp_code | [string](#string) | optional | The otp_code is used to verify the user&#39;s identity by MFA. |
| recovery_code | [string](#string) | optional | The recovery_code is used to recovery the user&#39;s identity with MFA. |
+| mfa_temp_token | [string](#string) | optional | The mfa_temp_token is used to verify the user&#39;s identity by MFA. |
@@ -748,6 +749,7 @@ When paginating, all other parameters provided to `ListUsers` must match the cal
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| token | [string](#string) | | |
+| mfa_temp_token | [string](#string) | optional | |
diff --git a/proto/generated-go/v1/auth_service.pb.go b/proto/generated-go/v1/auth_service.pb.go
index 64b1c4f6d1..a6aa9b0b68 100644
--- a/proto/generated-go/v1/auth_service.pb.go
+++ b/proto/generated-go/v1/auth_service.pb.go
@@ -560,6 +560,8 @@ type LoginRequest struct {
OtpCode *string `protobuf:"bytes,6,opt,name=otp_code,json=otpCode,proto3,oneof" json:"otp_code,omitempty"`
// The recovery_code is used to recovery the user's identity with MFA.
RecoveryCode *string `protobuf:"bytes,7,opt,name=recovery_code,json=recoveryCode,proto3,oneof" json:"recovery_code,omitempty"`
+ // The mfa_temp_token is used to verify the user's identity by MFA.
+ MfaTempToken *string `protobuf:"bytes,8,opt,name=mfa_temp_token,json=mfaTempToken,proto3,oneof" json:"mfa_temp_token,omitempty"`
}
func (x *LoginRequest) Reset() {
@@ -643,6 +645,13 @@ func (x *LoginRequest) GetRecoveryCode() string {
return ""
}
+func (x *LoginRequest) GetMfaTempToken() string {
+ if x != nil && x.MfaTempToken != nil {
+ return *x.MfaTempToken
+ }
+ return ""
+}
+
type IdentityProviderContext struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -814,7 +823,8 @@ type LoginResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
+ Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
+ MfaTempToken *string `protobuf:"bytes,2,opt,name=mfa_temp_token,json=mfaTempToken,proto3,oneof" json:"mfa_temp_token,omitempty"`
}
func (x *LoginResponse) Reset() {
@@ -856,6 +866,13 @@ func (x *LoginResponse) GetToken() string {
return ""
}
+func (x *LoginResponse) GetMfaTempToken() string {
+ if x != nil && x.MfaTempToken != nil {
+ return *x.MfaTempToken
+ }
+ return ""
+}
+
type LogoutRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -1089,7 +1106,7 @@ var file_v1_auth_service_proto_rawDesc = []byte{
0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2e, 0x0a, 0x13, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04,
- 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xa2, 0x02, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65,
+ 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xe0, 0x02, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70,
0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70,
@@ -1105,119 +1122,127 @@ var file_v1_auth_service_proto_rawDesc = []byte{
0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x6f, 0x74, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01,
0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64,
0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x6f, 0x76,
- 0x65, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6f,
- 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x65, 0x63, 0x6f,
- 0x76, 0x65, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x22, 0xc8, 0x01, 0x0a, 0x17, 0x49, 0x64,
- 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f,
- 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x53, 0x0a, 0x0e, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f,
- 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x41, 0x75, 0x74,
- 0x68, 0x32, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64,
- 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x6f, 0x61, 0x75,
- 0x74, 0x68, 0x32, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x4d, 0x0a, 0x0c, 0x6f, 0x69,
- 0x64, 0x63, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x28, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f,
- 0x49, 0x44, 0x43, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69,
- 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x6f, 0x69,
- 0x64, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x63, 0x6f, 0x6e,
- 0x74, 0x65, 0x78, 0x74, 0x22, 0x33, 0x0a, 0x1d, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x49, 0x64,
- 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f,
- 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x1d, 0x0a, 0x1b, 0x4f, 0x49, 0x44,
+ 0x65, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0e, 0x6d, 0x66,
+ 0x61, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x08, 0x20, 0x01,
+ 0x28, 0x09, 0x48, 0x02, 0x52, 0x0c, 0x6d, 0x66, 0x61, 0x54, 0x65, 0x6d, 0x70, 0x54, 0x6f, 0x6b,
+ 0x65, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6f, 0x74, 0x70, 0x5f, 0x63, 0x6f,
+ 0x64, 0x65, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5f,
+ 0x63, 0x6f, 0x64, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x6d, 0x66, 0x61, 0x5f, 0x74, 0x65, 0x6d,
+ 0x70, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xc8, 0x01, 0x0a, 0x17, 0x49, 0x64, 0x65, 0x6e,
+ 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74,
+ 0x65, 0x78, 0x74, 0x12, 0x53, 0x0a, 0x0e, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f, 0x63, 0x6f,
+ 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32,
+ 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72,
+ 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x6f, 0x61, 0x75, 0x74, 0x68,
+ 0x32, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x4d, 0x0a, 0x0c, 0x6f, 0x69, 0x64, 0x63,
+ 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x49, 0x44,
0x43, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
- 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x25, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69,
- 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b,
- 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22,
- 0x0f, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x22, 0x8b, 0x03, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
- 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61,
- 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
- 0x0e, 0x32, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05,
- 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61,
- 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72,
- 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x79,
- 0x70, 0x65, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x32, 0x0a, 0x09,
- 0x75, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32,
- 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73,
- 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65,
- 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x07, 0x20, 0x01,
- 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72,
- 0x64, 0x12, 0x24, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79,
- 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52, 0x0a, 0x73, 0x65, 0x72,
- 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x66, 0x61, 0x5f, 0x65,
- 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x6d, 0x66,
- 0x61, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x66, 0x61, 0x5f,
- 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x66,
- 0x61, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x6f, 0x76,
- 0x65, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52,
- 0x0d, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x2a, 0x54,
- 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x53,
- 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,
- 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12,
- 0x0e, 0x0a, 0x0a, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x5f, 0x42, 0x4f, 0x54, 0x10, 0x02, 0x12,
- 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x41, 0x43, 0x43, 0x4f, 0x55,
- 0x4e, 0x54, 0x10, 0x03, 0x2a, 0x48, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65,
- 0x12, 0x19, 0x0a, 0x15, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e,
- 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4f,
- 0x57, 0x4e, 0x45, 0x52, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x42, 0x41, 0x10, 0x02, 0x12,
- 0x0d, 0x0a, 0x09, 0x44, 0x45, 0x56, 0x45, 0x4c, 0x4f, 0x50, 0x45, 0x52, 0x10, 0x03, 0x32, 0xba,
- 0x06, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5c,
- 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x21, 0xda, 0x41, 0x04, 0x6e, 0x61,
- 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x66, 0x0a, 0x09,
- 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72,
- 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73,
- 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72,
- 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x75,
- 0x73, 0x65, 0x72, 0x73, 0x12, 0x5f, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73,
- 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x6f, 0x69, 0x64, 0x63,
+ 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,
+ 0x78, 0x74, 0x22, 0x33, 0x0a, 0x1d, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x49, 0x64, 0x65, 0x6e,
+ 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74,
+ 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x1d, 0x0a, 0x1b, 0x4f, 0x49, 0x44, 0x43, 0x49,
+ 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43,
+ 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x63, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x29, 0x0a,
+ 0x0e, 0x6d, 0x66, 0x61, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x6d, 0x66, 0x61, 0x54, 0x65, 0x6d, 0x70,
+ 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x6d, 0x66, 0x61,
+ 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x0f, 0x0a, 0x0d, 0x4c,
+ 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x8b, 0x03, 0x0a,
+ 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28,
+ 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74,
+ 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69,
+ 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14,
+ 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74,
+ 0x69, 0x74, 0x6c, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70,
+ 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08,
+ 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72,
+ 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f,
+ 0x6c, 0x65, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x08,
+ 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03,
+ 0xe0, 0x41, 0x04, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x24, 0x0a,
+ 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x08, 0x20, 0x01,
+ 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
+ 0x4b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x66, 0x61, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c,
+ 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x6d, 0x66, 0x61, 0x45, 0x6e, 0x61,
+ 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x66, 0x61, 0x5f, 0x73, 0x65, 0x63, 0x72,
+ 0x65, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x66, 0x61, 0x53, 0x65, 0x63,
+ 0x72, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5f,
+ 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x63,
+ 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x2a, 0x54, 0x0a, 0x08, 0x55, 0x73,
+ 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x54,
+ 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,
+ 0x00, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x53,
+ 0x59, 0x53, 0x54, 0x45, 0x4d, 0x5f, 0x42, 0x4f, 0x54, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x53,
+ 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x41, 0x43, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x03,
+ 0x2a, 0x48, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x15,
+ 0x55, 0x53, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
+ 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x57, 0x4e, 0x45, 0x52,
+ 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x42, 0x41, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x44,
+ 0x45, 0x56, 0x45, 0x4c, 0x4f, 0x50, 0x45, 0x52, 0x10, 0x03, 0x32, 0xba, 0x06, 0x0a, 0x0b, 0x41,
+ 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5c, 0x0a, 0x07, 0x47, 0x65,
+ 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x1e, 0xda, 0x41, 0x04, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3,
- 0xe4, 0x93, 0x02, 0x11, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f,
- 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x79, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55,
- 0x73, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x38, 0xda, 0x41, 0x10, 0x75, 0x73, 0x65, 0x72, 0x2c,
- 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02,
- 0x1f, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x32, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x75, 0x73,
- 0x65, 0x72, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d,
- 0x12, 0x67, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c,
- 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16,
- 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x21, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82,
- 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x6b, 0x0a, 0x0c, 0x55, 0x6e, 0x64,
- 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65,
- 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x26,
- 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75, 0x6e,
- 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x59, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12,
- 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f,
- 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65,
- 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01,
- 0x2a, 0x22, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6c, 0x6f, 0x67, 0x69,
- 0x6e, 0x12, 0x58, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x1a, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22,
- 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f,
- 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x42, 0x11, 0x5a, 0x0f, 0x67,
- 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x21, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3,
+ 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x66, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74,
+ 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73,
+ 0x12, 0x5f, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65,
+ 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65,
+ 0x72, 0x22, 0x1e, 0xda, 0x41, 0x04, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11,
+ 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72,
+ 0x73, 0x12, 0x79, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12,
+ 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
+ 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73,
+ 0x65, 0x72, 0x22, 0x38, 0xda, 0x41, 0x10, 0x75, 0x73, 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x04, 0x75,
+ 0x73, 0x65, 0x72, 0x32, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x67, 0x0a, 0x0a,
+ 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55,
+ 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70,
+ 0x74, 0x79, 0x22, 0x21, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02,
+ 0x14, 0x2a, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65,
+ 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x6b, 0x0a, 0x0c, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74,
+ 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93,
+ 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75, 0x6e, 0x64, 0x65, 0x6c, 0x65,
+ 0x74, 0x65, 0x12, 0x59, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x19, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f,
+ 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x58, 0x0a,
+ 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1a, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68,
+ 0x2f, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x33,
}
var (
@@ -1471,6 +1496,7 @@ func file_v1_auth_service_proto_init() {
(*IdentityProviderContext_Oauth2Context)(nil),
(*IdentityProviderContext_OidcContext)(nil),
}
+ file_v1_auth_service_proto_msgTypes[11].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
diff --git a/proto/generated-go/v1/auth_service.pb.gw.go b/proto/generated-go/v1/auth_service.pb.gw.go
index 9ddab82f50..ebc0080301 100644
--- a/proto/generated-go/v1/auth_service.pb.gw.go
+++ b/proto/generated-go/v1/auth_service.pb.gw.go
@@ -653,7 +653,7 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
// RegisterAuthServiceHandlerFromEndpoint is same as RegisterAuthServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAuthServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
- conn, err := grpc.DialContext(ctx, endpoint, opts...)
+ conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
diff --git a/proto/v1/auth_service.proto b/proto/v1/auth_service.proto
index 07867d3aa8..e10323b3a1 100644
--- a/proto/v1/auth_service.proto
+++ b/proto/v1/auth_service.proto
@@ -165,6 +165,9 @@ message LoginRequest {
// The recovery_code is used to recovery the user's identity with MFA.
optional string recovery_code = 7;
+
+ // The mfa_temp_token is used to verify the user's identity by MFA.
+ optional string mfa_temp_token = 8;
}
message IdentityProviderContext {
@@ -183,6 +186,8 @@ message OIDCIdentityProviderContext {
message LoginResponse {
string token = 1;
+
+ optional string mfa_temp_token = 2;
}
message LogoutRequest {