-
Notifications
You must be signed in to change notification settings - Fork 528
[docs] Create HowTo documentation on how to add Auth to VA directly rather than relying on Skills #1835
Comments
@andhdo Would a documentation page showing how you can take a Virtual Assistant and add an authentication step prior to calling the Graph be enough for what you need? This would also include the manual configuration steps required to create the authentication connection? |
Yes, It could be an initial start point, as a similar way basic examples of authentication does. Then it could be a good complement for local typescript skills development enabling & disabling authentication. |
OK - makes sense - I'll update this work item and get the docs updated next week for this. It's come up a few times as you say it's useful to do authentication purely within VA and not rely on Skills for some scenarios. The foundation is covered here and I'll focus it down for VA (and it will be much simpler than this) |
Yes; i've made the exercise to run this scenarios, but the idea is to implement it the best way inside virtual assistant without duplicate the code already made by Microsoft. |
Hi @andhdo, this doc should cover what you need: https://github.com/microsoft/botframework-solutions/blob/next/docs/reference/skills/manualauthsteps.md Reopen if needed. |
Hi @lauren-mills, Would you mind to tell us How can i reopen this issue? that because:
|
The steps to add authentication directly to VA should be the same as the steps to add them to a skill as listed in the document (hence why I pointed you to it.) I want to confirm that you are making all these changes to the VA Bot registration, and the VA app registration, correct? Can you go into the bot registration, in the settings tab, then select your OAuth connection and click "test connection" at the top and let me know what it says? Thanks. |
Yes; all according the procedure. see below the executed steps: STEPS TO REPRODUCE / VIRTUAL ASSISTANTinstall all requirements to run VA scaffold: PRERREQS
then the generation started and build process immediate after it.
first, you need to establish the connection with azure, and choosing a subscription with money (because all is money in az)
<SUBSCRIPTION_TO_WORK> = and then executing the generated script
VA_NAME: after that (and crossing the fingers to all become succesful), then you can start lowering the level of the resources that are expensive for the subscription output loks like that:
STEPS TO REPRODUCE / AUTHENTICATION
VA_AZADREG_NAME= then add graph api permissions
and
|
It seems like you have the authentication setup on your Virtual Assistant project. What are you missing that you would like our help with? |
Despite the configuration made, the project never requests for authentication to the user using VA. I've already added the authentication for the project but it would never activates the dialogs for authentication. I've already added the authentication for the project but it never activates the dialogs for authentication |
additional steps made in the application according documentation and errors seen in kudu: STEPS TO REPRODUCE / AUTHENTICATION-APP-CHANGES
|
To prompt for authentication, you will need to add an OAuthPrompt into your dialog at the desired place, providing the connection information when you configure it. This sample dialog from the Microsoft/botbuilder-samples repo should help: https://github.com/microsoft/BotBuilder-Samples/blob/master/samples/javascript_nodejs/18.bot-authentication/dialogs/mainDialog.js |
This is a good clarification because the method really does not add authentication to your bot, you must do some additional steps to secure your actions:
Some additional questions:
|
|
2: I mean: if exists (don't know if already exists or is it planned) a Middleware to ask for authentication credentials to the user before bring access to execute the maindialog requests logic, so you can let this logic intact |
I think that I've found a solution according your comments:
this is the less invasive method i've found untill now; however it lacks of 2 things: (1) it couldn't propagate the token to call graph if needed. (2) it's not the original middleware i thought |
Glad to hear you were able to get the prompt working. For accessing the token, it should be available in the next step (after the OAuthPrompt) in stepContext.Result. If you would like some advice on creating the Middleware you want, I would suggest going to our Stack Overflow, since it is better for general bot advice than this repo. |
Is your feature request related to a problem? Please describe.
Although the template generates code for graph api, there is not a simple example or procedure to test the authentication of a brand new generated virtual assistant and then consume this api.
What is the solution you are looking for?
A procedure, an example or configuration to enable the usage of graph client asking for authentication activation, after have the generated yeoman source code for virtual assistant in typescript, and a way with examples to deploy local skills in typescript.
What alternatives have you considered?
develop a new skill in typescript and use the
botskills connect
tool to try to see the changes to the virtual assistant solution and see the portions of code changed.Is there any other context you can provide?
a brand new skill generated has a similar and large portion of the source code of the original virtual assistance generator. To some simple deployment scenarios it is not practical to create a brand new bot solution for just a fragment of functionality of the overall virtual assistant (i.e: when the load of request is not meaningful). So there are some descriptions of parameters of the
botskills
tool to recognize the local manifest, but does not exists a real one typescript example working with local skills and does not exists an example of skills asking for oauth credentials in typescript.The text was updated successfully, but these errors were encountered: