Skip to main content

Notifications

Power Platform Community / Forums / Bot Administration / PVA Bot authentication...
Bot Administration
Unanswered

PVA Bot authentication with Slack

Posted on by

Hi everyone, I'm creating an internal use only PVA bot for employees at my company.  They will chat with the bot via Slack.  I want to enable authentication using the Generic OAuth2 option in PVA authentication so that my bot will know who the user is that it's talking to for opening tickets, addressing them by name, etc.  The problem is, I don't understand what I'm looking for for many of these fields as Slack doesn't use the same terminology as PVA and I'm not a dev 🙂

 

I created an app with Slack for my bot, and I have the client ID, secret, scope list delimiter figured out.  I believe authorization URL template is "https://slack.com/oauth/authorize" and Token URL template is "https://slack.com/api/oauth.access" but for the rest I am lost.

 

Authorization URL query string template

Token URL query string template

Token body template

Refresh URL template

Refresh URL query string template

Refresh body template

Token exchange URL (required for SSO)

Scopes

 

I'm really hoping that someone can point me to a filled out example form for Slack.  I can't possibly be the first person attempting this, can I?

 

Thanks!

 

  • drewf7 Profile Picture
    drewf7 2 on at
    Re: PVA Bot authentication with Slack

    Hi!

     

    I know this is a bit of an older post, but this came up when I was searching around for instructions on how to configure the generic OAuth2 provider, and since I figured it out I wanted to come back and leave some help in case someone else follows a similar path.

     

    This article from a blog called Project 365 ended up having the variable names I was looking for in order to configure things like "Token body template".

     

    I've copied the relevant section below. Instead of using the login.microsoftonline.com endpoints you would use whatever endpoints your IDP (Slack in this case) have documented for OAuth2.

     

    1. Client ID : Paste the application (client) id of the app identity.
    2. Client Secret : Paste the secret key that was created in the app registration portal for your app
    3. Scope : The list of scopes (API permissions) the authenticated users to have once signed in. This should match with the API permissions of PVA Bot app. 
    4. Scope List delimiter: Indicates the separator character for the scope list. This can’t be empty, and so set this field to , (comma)
    5. Authorization URL Template : Microsoft identity authorization end point is https://login.microsoftonline.com/common/oauth2/v2.0/authorize
    6. Authorization URL Query String Template : This field should set to the list of query parameters that will be appended to the authorization end point. Set this field to ?client_id={ClientId}&response_type=code&redirect_uri={RedirectUrl}&scope={Scopes}&state={State}
    7. Token URL Template : Microsoft identity token end point to get access tokens. This field is set to https://login.microsoftonline.com/common/oauth2/v2.0/token
    8. Token URL Query String Template : Usually this is a question mark ?
    9. Token Body Template : This field is the template of the token body. This field is set to code={Code}&grant_type=authorization_code&redirect_uri={RedirectUrl}&client_id={ClientId}&client_secret={ClientSecret}
    10. Refresh URL Template : Microsoft identity token end point to refresh access tokens. This field is set to https://login.microsoftonline.com/common/oauth2/v2.0/token
    11. Refresh URL Query String Template : Usually this is a question mark ?
    12. Refresh Body Template : This field is the template of the refresh token body. This field is set to refresh_token={RefreshToken}&redirect_uri={RedirectUrl}&grant_type=refresh_token&client_id={ClientId}&client_secret={ClientSecret}

Helpful resources

Quick Links

Exciting News for Copilot Studio Communi…

Get ready to experience a whole new level of engagement with the Copilot Studio…

Celebrating the May Super User of the…

LaurensM is an exceptional contributor to the Power Platform Community…

Check out the Copilot Studio Cookbook…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
renatoromao Profile Picture

renatoromao 6,459

#2
Pstork1 Profile Picture

Pstork1 1,997

#3
Expiscornovus Profile Picture

Expiscornovus 1,708

Leaderboard

Featured topics