Suite | すべてのプラン |
会話型サポートを提供する場合、ユーザーは複数のデバイスやチャネルを切り替えながら会話を続けることがあります。エンドユーザーを認証することで、すべてのタッチポイントが同じエンドユーザーに確実に関連付けられます。これにより、エージェントが提供するサポートの質を向上させ、エージェントがサポートする際にエンドユーザーに提供を求める個人情報のセキュリティを高めることができます。
関連記事:メッセージングのユーザー認証について
メッセージングの認証に関する用語
- JWT:Zendeskでは、メッセージングのエンドユーザー認証に署名されたJSON Webトークン(JWT)を使用します。これらのトークンには、エンドユーザーの本人確認を行うための情報が含まれています。JWTの詳細については、jwt.ioを参照してください。
- 署名キー:Zendeskの管理者が管理センターで作成し、チーム内の開発者と共有します。開発者はこの署名キーを使用して、必要に応じてJWTに署名を行います。
- 外部ID:外部システムで使用されているIDなど、各ユーザーに一意の英数字から成る文字列。メールアドレスがJWTに含まれている場合でも、これはメッセージング認証における重要な識別子となります。
- ユーザー名:(オプション)外部IDまたはメールアドレスに関連付けられたエンドユーザーの名前。JWTに含めたユーザー名が、エージェントワークスペースに表示されます。ユーザー名の情報は、エージェントがエンドユーザーとコミュニケーションを取る際に役立ちます。
- メール:(オプション)エンドユーザーに関連付けられた一意のメールアドレス。
メッセージングのエンドユーザー認証の実装の概要
ZendeskはJSON Webトークン(JWT)を使用して、メッセージング相手のエンドユーザーを認証し、ステートレスかつ柔軟な方法でユーザーIDを検証してAPIエンドポイントを保護します。
- メッセージング認証のプロセスでは、まず管理者が署名キーを生成して開発者に提供します。次に、開発者は署名キーを使用してバックエンドサービスを実装し、要求に応じてユーザーの署名付きJWTを作成できるようにします。
- 要求されると、バックエンドサービスは署名付きJWTを作成し、Webサイトやモバイルアプリに返します。このサービスによって作成されるJWTには、エンドユーザーを識別するための一意の外部IDと、オプションでメールアドレスを含める必要があります。
- ユーザーがログインするたびに、Webサイトやアプリは、Web WidgetやモバイルSDKで利用可能な同等のログインAPIを呼び出す必要があります。その際にJWTがZendeskに渡され、ユーザーの本人確認が行われます。
開発者向けの詳しい情報については、「Enabling authenticated visitors for messaging with Zendesk SDKs」を参照するか、次のビデオをご覧ください。
Webメッセージングでのエンドユーザーの認証(17:22)
署名キーの作成と共有
署名キーは、開発者がエンドユーザー用にJWTを作成するために使用します。署名キーを作成するには、管理者であることが必要です。最大10個のキーを作成できます。上限の10個に達した後にさらにキーを作成しようとすると、未使用のキーを削除するように求められます。
- 管理センターで、サイドバーの「
アカウント」をクリックし、「セキュリティ」>「エンドユーザー認証」を選択します。
- 「メッセージング」タブをクリックし、「キーを作成」をクリックします。
初めてキーを作成する場合は、「キーを作成」がページの一番下に表示されます。一番下に表示されない場合は、右上に表示されます。
- キーの「名前」を入力し、「次へ」をクリックします。
- プロンプトが表示されたら、「コピー」をクリックして共有シークレットをコピーします。
キーが保存され、IDが自動的に割り当てられます。キーのIDは、「エンドユーザー認証」ページの「メッセージング」タブにあるキーのリストで確認できます。
- 誰にも知られないように、キーのIDとコピーした共有シークレットを開発者に渡します。
- 「キーを永久に非表示にする」をクリックします。
外部IDのみによるエンドユーザーの認証
エンドユーザーを認証するには、ユーザーに発行するJWTに外部IDを含める必要があります。ZendeskはJWTで提供される外部IDを、メッセージングにおけるユーザー認証の主要な識別子として使用します。ユーザー認証を行う際、Zendeskはまず外部IDに一致する既存のユーザーを解決します。外部IDに一致するユーザーが存在しない場合に限り、JWTにメールアドレスが含まれていれば、そのアドレスを使用してユーザーIDを解決します。
外部IDのみでJWTに署名する
- external_id:(必須)各ユーザーを識別するために使用できる一意の英数字文字列です。詳しくは「ユーザーに発行するJWTで使用する外部IDを選択する」を参照してください。
-
scope:(必須)呼び出し元のアクセスのスコープ。有効な値は
user
のみです。 - name:(オプション)ユーザーの名前。JWTペイロードに名前を含めることで、Zendeskがエージェントワークスペースにユーザーの名前を表示できるようになり、エージェントがよりカスタマイズされたサポートを提供できるようになります。
{
"external_id": "12345678",
"scope": "user",
"name": "Jane Soap"
}
ユーザーに発行するJWTで使用する外部IDを選択する
- 外部IDは英数字から成る文字列であること。
- 外部IDは最大255文字まで。
- 各ユーザーの外部IDが、アカウントレベルでグローバルに一意であること。
アカウントに複数のブランドがある場合、外部IDはすべてのブランドで一意でなければなりません。
- ユーザーの外部IDは決して変更してはならない。
- ユーザーに割り当てられる外部IDは1つだけ。
外部IDの適切な選択例としては、最初のコンタクト時に割り当てられるインクリメントIDまたはランダム化ID(例:usr_12345)、あるいは、複数のブランドについては、ブランド固有の識別子とインクリメンタルIDまたはランダム化IDを組み合わせたもの(例:brand1_a8dedg)などがあります。
ユーザーのメールアドレスと電話番号は、時間の経過とともに変更されることがあり、複数の値を持つ場合もあるため、使用は避けてください。また、ユーザー名も一意でない可能性があるので避けてください。
ユーザー認証へのメールIDの組み込み
- 認証済みユーザーは、署名されたJWTによって認証されます。
JWTを使用すると、署名されたJWTの内容がエンドユーザーによって改ざんされることはないため、信頼できる方法となります。なりすまし攻撃の懸念がある場合は、メールIDの使用を認証済みエンドユーザーのみに制限することをお勧めします。この方法は最も安全なオプションであり、Zendeskアカウントの新規作成時のデフォルト設定になっています。
- 未認証ユーザーとは、Zendeskボットのプロンプトに対してメールアドレスを提供するエンドユーザーです。
なお、未認証ユーザーにメールIDの使用を許可すると、自分のものでないメールアドレスを渡して他のユーザーになりすますおそれがあり、なりすまし攻撃に対してセキュリティが脆弱になる可能性があります。
以下のフローチャートに、メッセージング認証でメールIDをどのように使用できるかを示します。
メールIDを設定する
Web Widgetやモバイルアプリを利用する際、ユーザーはフォームやAIエージェントのプロンプトに応じてメールアドレスを提供できます。このようなシナリオでは、悪意のあるユーザーが他人のメールアドレスを提供してなりすますことを防ぐ仕組みがありません。しかし、外部IDとメールアドレスの両方でユーザーを認証するためにJWTを使用することは、単にユーザーにメールアドレスを割り当てるよりも信頼性の高い方法です。
設定によっては、エージェントはフォームから収集したメールアドレスとJWTから提供されたメールアドレスの両方をユーザープロフィールで見ることができます。新しいZendeskアカウントでは、メールアドレスが有効になっており、確認済みのメールアドレスのみを使用するように設定されています。これが最も安全なオプションです。古いアカウントでは、認証済みのメールアドレスと未認証のメールアドレスの両方を使用するように設定されています。
- 管理センターで、サイドバーの「
チャネル」をクリックし、「メッセージングとソーシャル」>「メッセージング」を選択します。
- 「設定を管理」をクリックします。
- 「メールID」をクリックし、次のオプションのいずれかを選択します。
- 確認済みメールのみを使用する:(デフォルト)メールIDは、発行されたJWTに確認済みのメールアドレスが含まれている、認証済みのユーザーに対してのみ作成されます。
- 確認済みメールと未確認メールの両方を使用する:認証されたユーザーのメールアドレスがユーザープロフィールに表示されることに加え、AIエージェントフローを通じてユーザーから提供された未確認のメールアドレスもユーザープロフィールに追加されます。
- (非推奨)未認証のユーザーであっても、メールアドレスを確認済みメールアドレスとして利用できるようにしたい場合は、「未認証のユーザーが確認済みメールアドレスの所有権を主張できる」を選択します。
- 「設定を保存」をクリックします。
確認済みメールのみを使用する
メールIDは、発行されたJWTに確認済みのメールアドレスが含まれている、認証済みのユーザーに対してのみ作成されます。
このオプションを使用すると、エージェントは未認証のエンドユーザーから提供されたメールアドレスを会話履歴で確認できますが、そのユーザーに紐づけられたメールIDを見ることはできません。未認証のユーザーをメールでフォローアップする必要がある場合、エージェントは、そのユーザーレコードにメールIDを手動で追加する必要があります。
確認済みメールと未確認メールの両方を使用する
認証されたユーザーのメールアドレスがユーザープロフィールに表示されることに加え、AIエージェントフローを通じてユーザーから提供された未確認のメールアドレスもユーザープロフィールに追加されます。
このオプションは、悪意のあるユーザーがまだなりすまし攻撃を試みる可能性があるため、セキュリティ面で劣ります。ただし、エージェントはユーザープロフィールを検査し、メールアドレスが確認済みかどうかを判断することができます。未確認のメールアドレスは、エージェントワークスペースで目立つように表示されます。エージェントが補足メールを送信する必要がある場合、エンドユーザーの身元の信頼性を高めるために、セキュリティ質問を使用して本人確認を行うよう指示できます。
イベントの順序 | イベント | 結果のメールID |
---|---|---|
1 | 認証されていないユーザーが、フォーム収集されたメールアドレスを提供する。例:alice@example.org | Zendeskは未認証の新規ユーザー(id:12345)を作成し、未確認のメールID(alice@example.org)を使用する。 |
2 | 認証されたユーザーには、以下のクレームを持つJWTが発行される。
|
Zendeskは未認証の新規ユーザー(id:22345)を作成し、確認済みのメールID(alice@example.org)を使用する。 確認済みのメールIDに置き換えられたため、未認証のユーザー(id:12345)は未確認のメールIDを失う。 |
未認証ユーザーが確認済みメールアドレスの所有権を主張できるようにする(非推奨)
他のメールIDオプションとは対照的に、この設定では、プロンプトが表示されたときにそのユーザーのメールアドレスを入力するだけで、ユーザーが確認済みユーザーのIDを引き継ぐことができます。このオプションを選択すると、確認済みのメールアドレスが未確認のメールアドレスに優先されなくなります。
この方法は安全性が最も低く、なりすまし攻撃を受けやすいオプションです。AIエージェント機能が一時停止しているときに、プロアクティブメッセージをAIエージェント用から人間のエージェント用に更新した場合、アカウントで自動解決が再び利用可能になったときに手動でメッセージを再開する必要があります。
このオプションを選択すると、メッセージングチャネルで収集されたメールIDの確認ステータスは信頼できなくなります。これは、ユーザー認証後に現れたなりすましによって、その後のメッセージングのやりとりでそのメールのステータスが乗っ取られる可能性があるためです。これはつまり、なりすまし攻撃が成功する可能性が高くなり、エージェントはエンドユーザーが本人であるかどうかを知る手段が限られます。しかし、確認済みのメールIDは未確認のメールIDよりも優先され、確認済みのメールIDはなりすましのユーザーレコードから削除されます。
メールアドレスを含むJWTを発行する
- external_id:(必須)各ユーザーを識別するために使用できる一意の英数字文字列です。詳しくは「ユーザーに発行するJWTで使用する外部IDを選択する」を参照してください。
-
scope:(必須)呼び出し元のアクセスのスコープ。有効な値は
user
のみです。 - name:(オプション)ユーザーの名前。JWTペイロードに名前を含めることで、Zendeskがエージェントワークスペースにユーザーの名前を表示できるようになり、エージェントがよりカスタマイズされたサポートを提供できるようになります。
-
email:(必須)サインインしているユーザーのメールアドレス。ユーザーに一意のものでなければなりません。
メールアドレスを、エージェントワークスペースのユーザーのメインのメールアドレスと照合するように設定します。セカンダリメールアドレスをJWTに含めることはサポートされていません。
-
email_verified:(オプション)当該エンドユーザーがメールアドレスのオーナーシップを証明したかどうか。エンドユーザーに確認済みメールIDを関連付けたい場合、発行するJWTに
email
と"email_verified": true
の両方のクレームを含める必要があります。
{
"external_id": "12345678",
"email": "janes@soap.com",
"email_verified": true,
"name": "Jane Soap",
"scope": "user"
}
JWTにおける外部IDとメールアドレスの競合の解決
Zendeskは外部IDをメインの識別子として使用し、メールアドレスは外部IDに一致するものが見つからない場合にのみ使用します。
メッセージング認証は、競合を回避できるよう考慮して実装するのが最善です。たとえば、外部IDとZendeskのメール設定が競合しないように選択します。ただし、JWTで提示されたメールアドレスがすでに別の外部IDに関連付けられている場合、ZendeskはそのJWTを拒否し、エンドユーザーのログイン試行は失敗します。この場合、ユーザーは未認証状態で会話が開始されます
- JWTを更新して、異なる
external_id
値またはemail
アドレスを使用します。または
- 競合する
external_id
を持つユーザーを削除し、別のエンドユーザーが使用できるように解放します。Sunshine Conversations APIの「Delete User」を参照してください。
167件のコメント
Ivan Genchev
Hello Everyone,
I would like to share our experience with authenticating users and the disappointment following.
We are supporting tens of brands and authenticating users who log in in our websites and open a chat (messaging) via the widget. Each of our brands has a unique set of numbers as External ID. Users can register in any of our brands with the same email and they will be generated a different External ID for each Brand. This information is provided to Zendesk and a user is created in Support.
Sounds simple enough, however, once a user registers in more than 1 of our brands, they are forbidden by Zendesk to initiate a chat in the 2nd, 3rd, or any other brand after the first registration. This is due to the 409 error. The “solution” in the article is to manually or via API, remove the original user so that they can be registered anew and open a chat in the new brand, but this does not help as this would need to happen each time the user tries to open a chat in the original brand or in a new one.
For some reason, Sunshine Conversations cannot comprehend the same Email, being related to more than one External ID (or, since the External ID is the main identifier, more than 1 External ID cannot be related to the same Email). Which could make sense in some cases, but not for a platform that offers Multi-Brand usage.
“Solution” 1: To not pass our external IDs as External_ID, but pass the email as an External_ID. In this case, no matter where the user registers/logins, we will pass the same External_ID to Zendesk and there will be no conflict. Sounds good, the first registration is successful. The second registration (to a 2nd Brand) is also successful. However, users can view the history of the first brand in the chat of the second brand. This is absolutely baffling. Why would this even be a feature, why would a user need the history of Brand1 in the chat of Brand2? This can be a huge breach of trust in the customer. The answer to this question is that Sunshine Conversations just works like that..
“Solution” 2: What we are currently doing: Authenticate users as usual, and create a fallback for when a user encounters the 409 error (registered in more than 1 brand and initiates a chat). The fallback authenticates the user with the External ID, however instead of using the same Email, it creates a new email for them which looks like this: External_ID+Email (ex. 123456789+example@email.com). This is made so that each new registration in another brand will have a different email, so that Zendesk can allow them to be registered anew, instead of blocking them.
- So now if 1 user, with the email example@email.com registers in 3 Brands, he will have 3 separate users in Zendesk:
One as example@email.com , Second as 123456789+example@email.com and Third as 987654321+example@email.com .
- Great, at least they can initiate chats now. The issue? Only the original user can be used for email communication, as he is the only one with an actually legit email. So any email sent from/to Brand2 and Brand3 will go to the user for Brand1. Any chat communication will be saved in the interaction history for the respective user, but emails will never be seen as they should.
- So if the user comes in Brand3 and says “check the email communication”, you cannot simply view the Interaction History, you have to open an entirely separate user and check the email communication there.
- Sometimes, the original email example@email.com and an email such as 123456789+example@email.com will be added to the same user. In many of these cases, the 123456789+example@email.com is marked as Primary in the user's Zendesk profile. For another unknown reason, Zendesk does not allow us to send emails to the Secondary email, and it is only used for identification. So even if you type out example@email.com in the “Requester field”, it will recognize the user and automatically change the Requester to the primary email 123456789+example@email.com . This is obviously a non-existent email, so the sending will fail.
The only solution to this is to go inside the profile of the user, mark the example@email.com as verified and then change it to primary. Only then can an agent send an email to this customer.
The other “Solution” would be to not authenticate users at all but you can imagine how that is not exactly a solution.
After thorough communication with Zendesk Support, it seems this is our only workaround which includes all these pain points that force agents to do unnecessary manual work.
To us this seems as a major flaw for a platform that support multiple brands and I believe a solution to this should be of highest priority. At this point, the platform is basically punishing the customer for having a registration in more than 1 brand with the same email, and any workaround feels unpolished and irritating to agents for the manual steps they need to take.
I look forward to any feedback or other possible solutions that you may offer.
Thank you.
3
Anthony Plaza
Hello everyone, specific question.
Was the email authentication issue resolved?
I send the email, external_id, and other information in my JWT, but I've read all the messages since 2022, and it's April 2025, and I'm not sure whether to add the "email_verified" field since they say it duplicates the number of users.
Please confirm if this new feature is working correctly.
0
John Witt
8329079355674 I have found that Zendesk requires an email_verified status to see non-public articles. I send the userid of the current user ($AJAX user.me) as the external_id, email_verified true, and the email to create the token. The problem with this is it will always create a new user since external_id doesn't exists, so one workaround is to prepopulate every user's external_id with their user_id before testing Messaging. I prefer make.com and powerautomate, but I assume any integration tool or ZIS could do it. Worst case is you have two users and need to merge.
0
Pierre
Thanks 1263169242090
Just to make sure I understand it correctly.
Can I pre-populate the external id in zendesk or do I need to do this using an API?
My assumption is that the bot can automatically recommend articles based on the questions the end user asks. Or do we still need to pre-configure recommended articles for certain questions within the bot?
Thanks again for your help.
0
John Witt
My articles were private, and the only way around this is to use email, external id, and email_verified=true. However, if you don't pre-populate the external id before doing this, it will create a new user (you'll need to merge or delete the other one).
0
Pierre
1263169242090, thanks for you response.
We did get he web widget to work by using the backend service. We use the JWT token as described, but still the bot does not return any useful articles. Only when we make our articles public it works as it should.
Is there a setting somewhere in Zendesk that will allow the bot to return articles without us having to make all our articles public facing?
0
John Witt
8329079355674 To properly encode, you need the algorithm of H256, the correct kid (from Account;end user security), and type of JWT. The payload really just needs scope=user and external_id, but I use email, name, and verified.
I recommend using one of the JWT encoder/decoders and hardcode the value into the ZE call until you get it working. You might be missing a parm to encode in your encoder. I found I was getting 401 Login issues as I was using the wrong kid to encode.
0
Pierre
Hi,
We have build our backend service that will generate the JWT tokens. We have followed the instructions as per the steps in this document.
We generate a JWT token with the required claims and then use the token in Postman as a Bearer token to test it. But we keep on receiving the status code 401.
Is there anything else we should have configured on Zendesk apart from the Signing key in the Messaging section?
Or should the issuer and audience properties of the JWT token be specific values?
0
John Witt
1265194314089 Did you ever get an answer to this? I am seeing the same. It's almost like I want to add more logic - get the user via email, and if they don't have an external id, then create one using their user id, then send the JWT request. I think the issue is it sees there' no external_id, but can't use the email since it's already in use, and doesn't just assume the one with the correct email address is correct.
0
Tamir Bashkin
Hey, check out this app: https://www.zendesk.com/marketplace/apps/support/1066145/messaging-and-help-center-authentication . It helps authenticate Help Center users on the messaging widget. Highly recommended! :)
0
サインインしてコメントを残します。