Created
August 10, 2022 15:49
-
-
Save pedroaugusto/8c6fa7a160e6a53c0823f1028f9635b3 to your computer and use it in GitHub Desktop.
Configure custom slack Oauth Install page using Bolt Django
This file contains 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
import slack_bolt.oauth.oauth_flow | |
from slack_bolt.oauth.oauth_flow import OAuthFlow | |
from slack_bolt.request import BoltRequest | |
class CustomPageOauthFlow(OAuthFlow): | |
def build_install_page_html(self, url: str, request: BoltRequest) -> str: | |
return 'Hello world!' | |
settings=OAuthSettings( | |
client_id=client_id, | |
client_secret=client_secret, | |
scopes=scopes, | |
installation_store=DjangoInstallationStore( | |
client_id=client_id, | |
logger=logger, | |
), | |
state_store=DjangoOAuthStateStore( | |
expiration_seconds=120, | |
logger=logger, | |
) | |
) | |
app = App( | |
oauth_flow=CustomPageOauthFlow(settings=settings), | |
signing_secret=signing_secret, | |
oauth_settings=settings | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment