Change the flag to true to authorize your classic OAuth apps. ![]() It’s configurable by AppConfig’s the setter method for classicAppPermissionsEnabled. V2 OAuth 2.0 Flow (default) Authorization URLīy default, Bolt enables the V2 OAuth Flow over the classic one. The differences between the two types are having v2 in the endpoint to issue access tokens and the OAuth Authorization URL, plus some changes to the response data structure returned by the oauth(.v2).access endpoint. The V2 (this is a bit confusing but it’s not the version of OAuth spec, but the version of the Slack OAuth flow) OAuth flow enables Slack apps to request more granular permissions than the classic ones, especially for bot users. Slack has two types of OAuth flows for Slack app installations. Refer to the v1.9.0 release notes for more details. start () // If you want to turn the token rotation feature on, your InstallationService should be compatible with it. of ( "/slack/events", apiApp, // POST /slack/events (incoming API requests from the Slack Platform) "/slack/oauth", oauthApp // GET /slack/oauth/start, /slack/oauth/callback (user access) )) server. service ( stateService ) // Mount the two apps with their root path SlackAppServer server = new SlackAppServer ( Map. service ( installationService ) // Store valid state parameter values in Amazon S3 storage OAuthStateService stateService = new AmazonS3OAuthStateService ( awsS3BucketName ) // This service is necessary only for OAuth flow apps oauthApp. service ( installationService ) // Needless to say, oauthApp uses InstallationService // In addition, it uses OAuthStateService to create/read/delete state parameters App oauthApp = new App (). command ( "/hi", ( req, ctx ) -> ) apiApp. entry // API Request Handler App // expected env variables: // SLACK_SIGNING_SECRET App apiApp = new App () apiApp. ![]() Import .App import .jetty.SlackAppServer import import static java. App instances need to explicitly call asOAuthApp(true) to turn on them. As the OAuth flow handling features are unnecessary for many custom apps, those are disabled by default. Here is a Bolt app demonstrating how to implement OAuth flow.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |