Closed ravi-ojha closed 2 weeks ago
Hi @ravi-ojha, thanks for asking the question. You can use args.request.headers
to access cookie data your app can set.
Perhaps, parsing your service's auth session cookie string and assoiate your service's user ID and Slack's enterprise_id/team_id + user_id would be good to go. I hope this helps.
Ahh.. thank you! That was a bit stupid of me not to think about raw cookies. What using request.user
from Django does to a fella lol
And just wanna say thanks to everyone maintaining this package and examples. This part from django oauth example was a huge help!
Appreciate the help! Closing this now, I was able to build a nice custom bot for my side project Ticketping
What's my goal?
I'm creating a distributable slackbot app for my django project. I have followed the oauth flow from the example project and it works well.
Where am I stuck?
After the installation, I'd like to "link" the installation with the User model of my app. This will help me identify the slack installation for any user. Here's the quick view of App init.
Normally, I'd get the user from django's
request
but since theargs.request
is aBoltRequest
that doesn't work.One hacky way I could think of is to use the
SlackOAuthState
in some way, as in attach a user attribute to the SlackOAuthState object. When it is consumed, I can get the user attached to this state object.The
slack_bolt
version1.18.1
Python runtime version
3.9.10