-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way pass "login_hint" for OAuthPrompt #13115
Comments
👋 Hi @NWH-SAmin5, Thank you for reporting this issue! We want to let you know that: ⏱️ Our team will personally review your issue ✨ This is an AI-generated initial response To address your question about passing the "login_hint" parameter for an Issue DescriptionYou need to authenticate users using their privileged account rather than the regular account they are signed into Teams with. You want to pass the "login_hint" parameter to streamline the login process by pre-filling the username field during authentication. SolutionYes, it is possible to pass the "login_hint" parameter in the
Example ImplementationHere is an example of how you can set up an const { OAuthPrompt } = require('botbuilder-dialogs');
const oAuthPromptSettings = {
connectionName: process.env.CONNECTION_NAME || 'Myconnection',
text: 'Please sign in',
title: 'Sign in',
timeout: 300000,
// Add extra authentication parameters
oauthAppCredentials: {
clientId: process.env.MICROSOFT_APP_ID,
clientSecret: process.env.MICROSOFT_APP_PASSWORD,
},
// Additional parameters for OAuth
additionalOAuthParameters: {
login_hint: '[email protected]'
}
};
this.dialogs.add(new OAuthPrompt('OAuthPrompt', oAuthPromptSettings)); Detailed Steps
ReferencesAlternative ApproachIf you need more control over the OAuth flow, consider implementing custom authentication logic where you directly handle the construction of the OAuth authorization URL, including the const url = `https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize?client_id=${clientId}&response_type=code&redirect_uri=${redirectUri}&response_mode=query&scope=${scopes}&login_hint=${loginHint}`; This approach gives you the flexibility to construct the URL with any additional parameters you need. By following these steps, you should be able to pass the "login_hint" parameter to improve the sign-in process for users with privileged accounts. If you encounter any further issues or have additional questions, feel free to ask!
|
Thank you for bringing this issue to our attention. We will look into it and get back to you shortly. |
@NWH-SAmin5 |
@blackchoey Thank you for your response. I will open feature request on that repo |
Is your feature request related to a problem? Please describe.
As it is a common practice to provide admin privileges to a user to their privileged account and not regular account. Teams Bots which need to implement features and functionality for admins, would require to authenticate using their privileged account and not using the regular account they are signed in Teams with. Currently using Generic OAuth provider I was able implement ability to login as another account and sign out. But I need to be able to pass their username of the privileged account which will extremely improve the whole sign in process.
Describe the solution you'd like
Probably be able to pass "login_hint"
I understand implementing custom authentication logic where you directly handle the construction of the OAuth authorization URL, including the login_hint parameter and token storing, persisting, caching etc. But i think OAuthPrompt / TeamsBotSsoPrompt handles pretty much all of these, would prefer to extend these prompt to handle explicity "login_hint"
The text was updated successfully, but these errors were encountered: