4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Redmine / RedMica の二要素認証を強制的に解除する

Posted at

(対応バージョン: Redmine 4.2 / RedMica 1.2)

認証アプリをインストールした端末を紛失するなどしてワンタイムパスワードを生成できなくなったときに、Redmineがインストールされたサーバにアクセスして強制的に二要素認証を無効化する手順。

なお、個人設定画面で生成したバックアップコードを保管しておけばこの手順は不要。ワンタイムパスワードの代わりにバックアップコードを使ってログインと認証アプリの登録解除を行えばよい。

①Railsコンソール起動

Redmineサーバ上でRailsコンソールを起動。

cd path/to/redmine
bin/rails c -e production

②Railsコンソール上で特定ユーザーの二要素認証を解除

Railsコンソール上で二要素認証を解除するためのメソッドを呼び出す。

# 二要素認証を解除したいユーザー(以下の例はログインIDが foo であるユーザー)に
# 対応するオブジェクトを取得
user = User.find_by(login: 'foo')

# 二要素認証解除
require 'redmine/twofa/base'
twofa = Redmine::Twofa::Base.new(user)
twofa.destroy_pairing_without_verify!
4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?