Skip to content

Instantly share code, notes, and snippets.

@pedroaugusto
Created August 10, 2022 15:49
Show Gist options
  • Save pedroaugusto/8c6fa7a160e6a53c0823f1028f9635b3 to your computer and use it in GitHub Desktop.
Save pedroaugusto/8c6fa7a160e6a53c0823f1028f9635b3 to your computer and use it in GitHub Desktop.
Configure custom slack Oauth Install page using Bolt Django
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