Skip to content

Commit

Permalink
Merge pull request #404 from lhhyung/master
Browse files Browse the repository at this point in the history
Update MFA requirement to apply only for LOCAL auth_type
  • Loading branch information
lhhyung authored Nov 1, 2024
2 parents 0ffa3a4 + 86ddbc7 commit 682c3ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/spaceone/identity/manager/secret_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ def delete_user_secret(self, user_secret_id: str) -> None:

def delete_user_secret_with_system_token(self, domain_id: str, user_secret_id: str) -> None:
system_token = config.get_global("TOKEN")
self.secret_conn.dispatch("UserSecret.delete", {"user_secret_id": user_secret_id}, x_domain_id=domain_id, token=system_token)
self.secret_conn.dispatch("UserSecret.delete",
{"user_secret_id": user_secret_id},
x_domain_id=domain_id,
token=system_token)

def get_user_otp_secret_key(self, user_secret_id: str, domain_id: str = None) -> str:
user_secret_info = self.get_user_secret_data(user_secret_id, domain_id)
Expand Down
2 changes: 1 addition & 1 deletion src/spaceone/identity/service/token_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def issue(self, params: TokenIssueRequest) -> Union[TokenResponse, dict]:

mfa_user_id = user_vo.user_id

if user_mfa.get("state", "DISABLED") == "ENABLED" and params.auth_type != "MFA":
if user_mfa.get("state", "DISABLED") == "ENABLED" and params.auth_type == "LOCAL":
mfa_manager = MFAManager.get_manager_by_mfa_type(mfa_type)
if mfa_type == "EMAIL":
mfa_email = user_mfa["options"].get("email")
Expand Down

0 comments on commit 682c3ec

Please sign in to comment.