-
Notifications
You must be signed in to change notification settings - Fork 228
Update instructions in documentation for OAuth examples #1262
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
Conversation
zimeg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Some notes for the reviewers!
| SlackAppServer server = new SlackAppServer(Map.of( | ||
| SlackAppServer server = new SlackAppServer(new HashMap<>(Map.ofEntries( | ||
| entry("/slack/events", apiApp), // POST /slack/events (incoming API requests from the Slack Platform) | ||
| entry("/slack/oauth", oauthApp) // GET /slack/oauth/start, /slack/oauth/callback (user access) | ||
| )); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This raises the following error for me on openJDK 19:
[main] INFO org.eclipse.jetty.util.log - Logging initialized @2068ms to org.eclipse.jetty.util.log.Slf4jLog
Exception in thread "main" java.lang.UnsupportedOperationException
at java.base/java.util.ImmutableCollections.uoe(ImmutableCollections.java:142)
at java.base/java.util.ImmutableCollections$AbstractImmutableMap.putAll(ImmutableCollections.java:1080)
at com.slack.api.bolt.jetty.SlackAppServer.<init>(SlackAppServer.java:121)
at com.slack.api.bolt.jetty.SlackAppServer.<init>(SlackAppServer.java:70)
at NitroApp.main(ExampleApp.java:130)
| |**SLACK_INSTALL_PATH**|**Starting point of OAuth flow**: This endpoint redirects users to the Slack Authorize endpoint with required query parameters such as `client_id`, `scope`, `user_scope` (only for v2), and `state`.<br><br>The suggested path is `/slack/oauth/start` but you can go with any path. Note that the example above automatically prepends `/slack/oauth` to this variable.| | ||
| |**SLACK_REDIRECT_URI_PATH**|**Path for OAuth Redirect URI**: This endpoint handles callback requests after the Slack's OAuth confirmation. The path must be consistent with **SLACK_REDIRECT_URI** value.<br><br>The suggested path is `/slack/oauth/callback` but you can go with any path. Note that the example above automatically prepends `/slack/oauth` to this variable.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1262 +/- ##
=========================================
Coverage 74.31% 74.31%
Complexity 4120 4120
=========================================
Files 443 443
Lines 13078 13078
Branches 1322 1322
=========================================
Hits 9719 9719
Misses 2587 2587
Partials 772 772 ☔ View full report in Codecov by Sentry. |
filmaj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure the implication of changing the mapping class used here and how that affects which Java runtime will have compatibility (or not), so I would prefer to wait for Kaz to provide his opinion.
seratch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!

Summary
This PR makes a few changes to the OAuth examples in documentation to remove some confusion:
/slack/oauthis added to the server URL for*_PATHenvironment variables to avoid unknowingly creating paths like/slack/oauth/slack/oauth/start.Category
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.