Skip to main content

Notifications

Copilot Studio - Calling Actions from Copilot S...
Unanswered

How to setup authentication in power virtual agents

(0) ShareShare
ReportReport
Posted on by 4

Hi,

I'm trying to connect authentication using access_token to power agents but it gives me error saying bad request. but token is there in the url. if i try the token to call the API, that is a valid token. 

 

If i try with code response_type, code is generating but cannot call API requests,it gives me 401

Categories:
  • Max44 Profile Picture
    Max44 221 on at
    Re: How to setup authentication in power virtual agents

    In Power Virtual Agents, select Manage on the side navigation pane and then go to the Authentication tab.
    Enter the information as described for each of the fields in the following table. The information required depends on your setup and provider.
    Click Save to finish the configuration.

  • jblackburn410 Profile Picture
    jblackburn410 2 on at
    Re: How to setup authentication in power virtual agents

    Any movement on this? I'm having the same problem and used the details found here https://poszytek.eu/en/microsoft-en/office-365-en/pva-en/pva-series-authentication-in-power-virtual-agent/ with a new Client ID and secret generated in the same environment on Azure AD.

     

    I see a similar topic was resolved, however this was using Dynamics and Flow and isn't relevant to this particular thread. 

  • csomasiri Profile Picture
    csomasiri 4 on at
    Re: How to setup authentication in power virtual agents

    I'm calling an action defined in the flow. and passing the auth token to there(using organizational account). so authentication success and flow throws 401. please find the attached screenshots as requested.

     

    Token URL Template

    https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token

     

    Token Body Template

    code={Code}&grant_type=authorization_code&redirect_uri={RedirectUrl}&client_id={ClientId}&client_secret={ClientSecret}

     

    Authorization URL Template

    https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize

     

    Authorization URL Query String Template

    ?client_id={ClientId}&response_type=code&redirect_uri={RedirectUrl}&scope={Scopes}&state={State}

     

    If i change the response type to following, it shows bad request but in the url it has a valid access token response_type=id_token+token

  • CleberM Profile Picture
    CleberM on at
    Re: How to setup authentication in power virtual agents

    @csomasiri can you give us some screenshots of the issue you're experiencing, so we can try to understand the issue better?

  • csomasiri Profile Picture
    csomasiri 4 on at
    Re: How to setup authentication in power virtual agents

    Yes, i'm using the Manage -> Authentication

     

    When i used default values or values in this post, it is generating a token but cannot use that as access token since it gives me 401 error. so to use as access token, i need to change response_type to id_token+token or something. when ever i change that, it gives me bad request, but still valid access_token is there in the url

  • CleberM Profile Picture
    CleberM on at
    Re: How to setup authentication in power virtual agents

    Hi @csomasiri,

     

    How are you connecting authentication on Power Virtual Agents? Are you using the configuration under "Management" > "Authentication"?

     

    Usually a "Bad request" response when the user is signing in means there is a mistake on the configuration. Even a stray space " " can cause that, so I would double check the configuration to see if there is anything there.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,691

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 65,019

Leaderboard

Featured topics