1
0

SSOのまとめ

Last updated at Posted at 2022-02-21

まとめページに戻る
まとめN~Z

use OAuth:

using SAML :

日本語だけのヘルプ

早速ですが、PCのシングルサインオンは実現できていますが、それをSalesforceモバイルアプリケーションを利用すると、classic画面に飛ばされてしまいます。

特段の設定が必要といったわけではなくPCができていれば、モバイルでデフォルトの"本番"ではなく私のドメインURLで認証すませればログインできる形でした。

  • Lightning Experience doesn’t support incognito or other private browsing modes.

https://help.salesforce.com/s/articleView?id=release-notes.getstart_browsers_sfx.htm&release=238&type=5

運用面

私の組織はポリシーにより 100% SSO になっていますが、同様のことが起こりました。時折、自分のアカウントまたは別のユーザーのアカウントのユーザー/パス設定を確認する必要があります。

組織で SSO 権限を割り当てるために権限セットを使用しています。パスワードをリセットする必要があるアカウントのその権限セットを一時的に削除し、パスワードのリセット プロセスを実行します。その後、ユーザー/パスが必要なものにログインし、SSO 権限セットをオンに戻します。

これはユーザーにパスワードを設定するための一時的な方法にすぎないかもしれませんが、私にとってはうまくいきました。

資料

image.png

認証には Azure SSO も使用します。新規ユーザーの場合は認証は必要ありません。サンドボックスは通常、設定 / 電子メール / 到達性が「アクセスなし」に設定されています。これが真の場合、サンドボックスから電子メールは送信されません。

OAuthエラーのため、あなたを認証できません。詳細は、Salesforceシステム管理者に

お問い合わせください。

OAUTH_APPROVAL_ERROR_GENERIC:認証中、予期せぬエラーが発生しました。

もう一度お試しください。

同じようなエラーが既知の問題に上がっているようです。

Salesforce App users cannot login see error - OAUTH_APPROVAL_ERROR_GENERIC
https://issues.salesforce.com/issue/a028c00000gAz9lAAC/salesforce-app-users-cannot-login-see-error--oauth_approval_error_generic

この問題は私の設定に対する認識不足から起こったものと確認できましたので報告します。

ソーシャルIDプロバイダーを使ったSSOを 同じデバイスで 組織の複数のユーザにログインして設定を試みましたが 組織管理者が個々のユーザーのソーシャルIDを指定することはできないようです。よって2番目の登録ユーザーでは当初質問のエラーとなり該当メッセージが表示されると確認しました。

よって代表するユーザーを作成してそのSSOを設定し複数の組織ユーザーで運用する(その目論見でしたが質問者のアカウント以外に運用ユーザをSSO設定する作業をしてしまった)場合本件の問題をクリアーしておく必要があるようです。

  1. Checking that the timestamps in the assertion are valid

Current time is after notOnOrAfter in Conditions

Current time is: 2021-06-09T21:33:08.118Z

Time limit in Conditions, adjusted for skew, is: 2021-06-09T19:47:18.556Z

Timestamp of the response is outside of allowed time window

Current time is: 2021-06-09T21:33:08.118Z

Timestamp is: 2021-06-09T19:39:18.556Z Allowed skew in milliseconds is 480000

Timestamp of the assertion is outside of allowed time window

Current time is: 2021-06-09T21:33:08.118Z

Timestamp is: 2021-06-09T19:39:18.556Z

Allowed skew in milliseconds is 480000

I had this issue today. We use Federation ID on the User record for SSO.

Our Resolution: Copy/paste Fed ID value (email address in our case) into Notepad --> Copy/Paste back into Fed ID field. This removes any special characters that may not be visible.

You account has been disabled.Your company administrator has disabled access to the system for you. Please contact your administrator for more information.

Just to close the loop on this, it turned out the user with the problem had another user record in our SFDC that was inactive but the name was different on the record. The user later changed the name they go by and it was updated in active directory. The user never needed Salesforce access until recently and the old record was still connected with their active directory record. I simply had to revoke the SSO connection under Third Party Account Links on this inactive user record to resolve the issue.

設定

Could you please double check single sign-on settings in your salesforce org if it is configured to use Federation ID as SAML identity type or username. If federation Identity type is configured to use username as identity type, it will use username even though you have entered Federation ID on user record.

Salesforce 組織のシングルサインオン設定が SAML ID タイプまたはユーザ名としてフェデレーション ID を使用するように設定されているかどうかを再確認してください。フェデレーション ID タイプが ID タイプとしてユーザー名を使用するように構成されている場合、ユーザー レコードにフェデレーション ID を入力したとしても、ユーザー名が使用されます。

以下の説明が役に立つと思います。

Salesforce で多要素認証が必須に - Azure AD 側での対応
https://jpazureid.github.io/blog/azure-active-directory/salesforce-now-enforcing-multi-factor-authentication-azure-ad/

メール検証済

弊社ではSAMLのJITプロビジョニングを利用してユーザーアカウント作成しており、
作成時にメールアドレスに届いたリンクをクリックするような運用が発生しておらず。作成されたユーザーはほぼ未検証の状態でございます。
どうやって、メールを検証済にするか

アイデアには上がっているのですが、賛同者は少ないみたいですね。

Need a way to verify a User Email address for SSO only users
https://ideas.salesforce.com/s/idea/a0B8W00000Gdmf5UAB/need-a-way-to-verify-a-user-email-address-for-sso-only-users

ずっと使える方法ではないかもしれませんが、、非同期メール API メソッドという方法があるようです。

ユーザーのメール検証を開始する方法はいくつかあります。いずれの場合でも、ユーザーは未検証のメールアドレス宛に検証リンクを受信します。検証リンクは 72 時間後に期限切れになります。ユーザーが期間内にリンクをクリックしなかった場合、新しいリンクを送信できます。

  • 1 人のユーザーの検証を開始するには、[ユーザー] 設定ページでユーザーを選択します。ユーザーのメールアドレスの横で、[検証] をクリックします。
  • 複数のユーザーの検証を同時に開始するには、非同期メール API メソッド (リリースプレビューの時点で内容が更新されることや、項目が参照不可になることがあります) を使用します。
  • ユーザーはメールアドレスの横にある [検証] をクリックすることで、[高度なユーザーの詳細] ページから自分で検証を開始できます。

または、ユーザーがパスワードをリセットすると、そのプロセス中にメールアドレスが自動的に検証されます。ユーザーはメールで送信されたパスワードリセットリンクをクリックすることで、メールアドレスの所有権を確認します。

https://help.salesforce.com/s/articleView?id=release-notes.rn_security_email_verification.htm&release=246&type=5

Unable to find Subject

Sandoboxでの運用

サンドボックスを作成または更新するときに、ユーザーに SSO の使用を強制して私のドメインからログイン ポリシーをコピーしないオプションがあれば便利です。現在、サンドボックスを作成するたびに、バックドア URL を使用してログインし、[私のドメイン] でこの設定を無効にする必要があります。本番環境では SSO を使用しますが、サンドボックスでは使用しません。そのため、ユーザーがネイティブの Salesforce ログイン ページからログインできないようにしたくありません。

エラー

image.png

既知の問題に紹介されている解決方法では納得しないらしい。

Workaround

Once the user is presented with the error, please have them select "Use a Different Verification Method". They can then choose to manually enter the 6 digit code presented within the Authenticator app for the username they are attempting to login with.

https://trailblazer.salesforce.com/issues_view?id=a1p4V0000003ykpQAA

ユーザーにエラーが表示されたら、「別の検証方法を使用する」を選択してもらいます。その後、ログインに使用するユーザー名として、Authenticator アプリ内に表示される 6 桁のコードを手動で入力することを選択できます。

If users are having issues signing in using Single Sign-On (SSO), you can troubleshoot by checking the login history. Look for whether the problem is related to a SAML assertion error or a configuration issue. If it's an assertion problem, use the SAML Assertion Validator to pinpoint the specific issues.

Collaborate with your identity provider to make sure both the SAML assertion and your SSO settings are correct and valid.

Please check out below help articles which can be helpful in troubleshooting the issue:

https://help.salesforce.com/s/articleView?language=en_US&id=sf.sso_saml_validation_errors.htm&type=5

https://help.salesforce.com/s/articleView?id=000382294&type=1
https://help.salesforce.com/s/articleView?id=000385386&type=1
https://www.salesforceben.com/how-to-troubleshoot-a-single-sign-on-error/

ユーザーがシングル サインオン (SSO) を使用してサインインする際に問題が発生した場合は、ログイン履歴を確認することでトラブルシューティングを行うことができます。問題が SAML アサーション エラーに関連しているのか、それとも構成の問題に関連しているのかを確認します。アサーションの問題の場合は、SAML アサーション バリデータを使用して特定の問題を特定します。

ID プロバイダーと協力して、SAML アサーションと SSO 設定の両方が正しく有効であることを確認してください。

問題のトラブルシューティングに役立つ以下のヘルプ記事をご確認ください。

We can’t log you in because there is an issue with single sign-on. Contact your Salesforce admin for help.

Usually, this error occurs if there is a change in the Federation ID.

We have faced a similar issue in the past and if there is a Federation ID this error cause.

Solution: Lower case, Upper case All data has to be case sensitive.
https://developer.salesforce.com/forums/?id=9062I000000g4e9QAA

Please make sure that below two Items are in place:

  1. Users That are not able to use SSO, They are added to Azure Directory for the ORG that you want to give access in.
  2. Federation ID: make sure the federation Id in User Record (Salesforce) is the same as in Azure. This is case sensitive.
    https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8HlWSAV

can't find "Single Sign-On Settings" in Sia Thripio's user edit and can't find edit option in Single Sign-On Settings.

What I have done to is to close my org and relaunch again, then the "Edit" option reappeared for me to disable and enable the SAML.

私がやったことは、組織を閉じて再度起動すると、SAML を無効または有効にするための [編集] オプションが再び表示されました。

NO_ACCESS: Unable to find a user

NO_ACCESSのエラーの説明によると以下のようです。

正しいユーザ名を使っていますか?
ユーザーを検索できない。例: ユーザー名が存在しない。

https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_flow_errors.htm&type=5


よく分からんエラー 1

また嘘だろう1時間でできると書いてあるけど、既に昨日は3時間悩んだけど1問も進めない。嘘つきすぎる。

Multi-Factor Authentication and Single Sign-On Settings Superbadge Unit

SSOは設定できたハズなんですが...
image.png

何も設定しないでそののままクリック。
We can't find the setting that prevents users from logging in with their Salesforce credentials.

権限セットをつくれとか言っているんですが、そもそもSSOを有効とかの権限はないんですよねぇ。
ヘルプ見ても書いているけどないよ?

権限セット中身は無いを作っただけ。SSOの有効化がみつからん
We can't find the required profile, users, or settings installed in your org. Make sure you're using the special Developer Edition org made for this superbadge located toward the top of the scenario.

まぁ、いつもの嘘つきヘルプだろう。

SSO を使用したログインをユーザに要求

ユーザに SSO を使用して Salesforce にログインするように要求する手順は、次のとおりです。

  • login.salesforce.com を介した直接ログインを無効にします。
  1. [設定] の [クイック検索] ボックスに「会社の設定」と入力し、[私のドメイン] を選択します。
  2. [ポリシー] セクションで [編集] をクリックします。
  3. [https://login.salesforce.com からログインできないようにする] を選択してログインポリシーを設定し、変更を保存します。
  • Salesforce ログイン情報を使用したログインを無効化します。
  1. [設定] の [クイック検索] ボックスに「シングルサインオン」と入力し、[シングルサインオン設定] を選択します。
  2. [編集] をクリックします。
  3. [代理認証] で、[Salesforce ログイン情報を使用したログインを無効化] を選択し、変更を保存します。
  • プロファイルレベルで SSO を有効にします。
  1. [設定] から、[クイック検索] ボックスに「プロファイル」と入力し、[プロファイル] を選択します。
  2. 目的のプロファイルを編集し、[システム管理者権限] セクションを見つけます。
  3. [シングルサインオンの有効] を選択して、変更を保存します。
    または、権限セットを使用して特定のユーザにこの権限を割り当てることもできます。詳細は、「権限セット」を参照してください。

え、一晩経ったら出てきた。何でだ。昨日は3時間も探したのになかった。
image.png

権限セットを変更しても変わらんなぁ。
We can't find the required profile, users, or settings installed in your org. Make sure you're using the special Developer Edition org made for this superbadge located toward the top of the scenario.

プロファイルにも同じ設定をしたけど...
We can't find the required profile, users, or settings installed in your org. Make sure you're using the special Developer Edition org made for this superbadge located toward the top of the scenario.

何でか知らんけど、姓名が逆かよ!!
set up Murphy Jean as your SSO test user.
image.png

よく分からんエラー 2

ログイン先 https://fukadaelectric-dev-ed.my.salesforce.com/

お約束。何も設定せずにクリック。

We can't find the correct SAML Single Sign-On settings.
組織にインストールされている必要なプロファイル、ユーザー、または設定が見つかりません。シナリオの上部にあるこのスーパーバッジ用に作成された特別なDeveloperEdition組織を使用していることを確認してください。

何を設定していいかさっぱりわからん。 SAML Configurations って昨日設定したよ。

ここにあるように2ユーザ共にテストもしてOKだったんだけど... 何が足りないのかさっぱり分からない。
https://trailhead.salesforce.com/ja/content/learn/modules/identity_login/identity_login_sso

image.png

色々触っていると
We can't find the required profile, users, or settings installed in your org. Make sure you're using the special Developer Edition org made for this superbadge located toward the top of the scenario.

またこれだ。はいはい、2人目も姓名逆だったんで修正しましたよ。

しかない権限セットでなく、プロファイルのシングルサインオン有効にもチェックを入れていたのでチャックを外すと
We can't find the correct SAML Single Sign-On settings.

ああ、赤いところが漏れていました。
image.png

よく分からんエラー3

お約束

In the 'MFA Authorization for Break Glass Admin' permission set, we can't find the expected settings.

MFA Authorization for Break Glass Adminにライセンスの指定をしていなかったので、とりあえず消す。

消すと権限セットがないというエラーになるなぁ。
We can't find the 'MFA Authorization for Break Glass Admin' permission set.

元に戻った。何が違う?

この設定をしたんだけどなぁ。ほんとやる気が失せる。
https://help.salesforce.com/s/articleView?id=000358170&type=1

In the 'MFA Authorization for Break Glass Admin' permission set, we can't find the expected settings.

チェックしている場所が違った。

またこれだぁ、意味が分からん
We can't find the required profile, users, or settings installed in your org. Make sure you're using the special Developer Edition org made for this superbadge located toward the top of the scenario.
さっきの設定場所が分からんかったので、言語設定を日本語にしたままだったからのようです。
ほんとうにやる気が失せます。英語以外の言語をないがしろにしすぎだ。フランス人も怒ってたしなぁ。分かる。

よく分からんエラー4

お約束

We can't see that Brochan Pane has successfully connected to your org with the Salesforce Authenticator app.

何回ログインしてもこのエラーになる。やっぱりいつものようにチェックロジックは何を見ているのかなぁ。

We can't see that you were able to successfully test your Lightning Login configuration for Brochan Pane.

言語設定を日本語にするとこのエラーになる。ということはちゃんとBrochan Paneを検索しに行っているということだな。
We can't find the required profile, users, or settings installed in your org. Make sure you're using the special Developer Edition org made for this superbadge located toward the top of the scenario.

仕方なくもう一度新しいDE環境を作成。 

ログイン先 https://fukadaelectric2-dev-ed.my.salesforce.com

よく見たらエラーメッセージが違う?

これをやってみる。
https://tyoshikawa1106.hatenablog.com/entry/2017/01/03/192226

1回目では同じエラーです。何度もやってみます。ログアウトも何度もします。

おお、何故か今回はOKになった。意味が分かりません。

矢印の変なマークが出てこないとダメなのか?
image.png

それぞれ何度もログインしたハズなのにログには記録されてないように思います。
キャッシュの問題かな?
image.png

1
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
1
0