-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Hi Team,
We’ve set up the Authorization Agent to handle token exchange without using a SignIn card, by configuring the Token Exchange URL within the OAuthSettings.
However, we’re encountering an issue where the auto sign-in process doesn’t consistently succeed on the user's first message. In most cases, the auto sign-in only completes successfully after the user sends 3 or more random messages. Once it succeeds, the request reaches the OnMessageAsync method as expected.
App Registration Configuration
Below are the configuration steps we followed for the Azure App Registration:
- Authentication
-
Added a Web platform with the Redirect URL:
https://token.botframework.com/.auth/web/redirect -
Enabled both checkboxes under Implicit grant and hybrid flows for:
- Access tokens
- ID tokens
- API Permissions
-
Added permissions for Microsoft Graph (Delegated):
- User.Read
- openid
- profile
- offline_access
-
Added permissions for Power Platform API (Delegated):
- CopilotStudio.Copilots.Invoke
-
Granted admin consent for the tenant.
-
Certificates & Secrets
Created a new client secret and securely stored the secret value.
-
Expose an API
-
Set Application ID URI to api://botid-
- Added a scope:
- Scope name: access_as_user
- Who can consent: Admins
- Admin consent display name: Access Copilot Agents as user
- Admin consent description: Allow the app to access Copilot Agents as you
- State: Enabled
OAuthSettings Configuration
- Name: MyTestApp
- Service Provider: Azure Active Directory v2
- Client Id: {Azure Bot Client Id}
- Client Secret: {Azure Bot Client Secret}
- Token Exchange URL: api://botid-{Azure Bot Client Id}
- Tenant Id: {Tenant Id}
- Scopes: profile openid
Issue
We need the auto sign-in to reliably succeed when the user sends their first message, without requiring multiple retries. Could you please help us identify what might be causing this behavior or suggest configuration adjustments to ensure a seamless auto sign-in experience on the first attempt?
Thanks in advance for your help!