Repository navigation
feat: harden the install callback (full redirect_uri, no exchange without a code, optional state check) - #56
Merged
Merged
Conversation
…hout a code, an optional state check - redirect_uri is the callback's PathBase plus Path, so the middleware works mounted as an endpoint as well as with app.Map - a callback without a code never exchanges; OAuthOptions.CancelledRedirectUri takes a declined install to the app's page - OAuthOptions.ValidateState runs before the exchange; a refused state, or a code Slack refuses, goes to FailedRedirectUri (a bare 403 or 500 without one)
…ncel from a failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
app.Map, becauseredirect_uriis the callback's full URL (PathBase+Path);app.Mapusers get the same URL as beforecode(?error=access_denied) never exchanges anything; the newOAuthOptions.CancelledRedirectUrisends it to the app's page with itsstateand Slack'serror(so the page can tell a cancel from a failure), and left unset the request goes on to the next middleware as beforeOAuthOptions.ValidateStatechecksstatebefore the code is exchanged orInstallruns, so a stray or forged callback installs nothingOAuthOptions.FailedRedirectUriinstead of a 500 with Slack's error textOAuthCallbackTests