33import os
44from asyncio import Future
55from io import IOBase
6- from typing import Union , List
6+ from typing import Union , List , Optional
77
88import slack .errors as e
99from slack .web .base_client import BaseClient , SlackResponse
@@ -1462,15 +1462,18 @@ def mpim_replies(
14621462 return self .api_call ("mpim.replies" , http_verb = "GET" , params = kwargs )
14631463
14641464 def oauth_v2_access (
1465- self , * , client_id : str , client_secret : str , code : str , ** kwargs
1465+ self , * , client_id : str , client_secret : str , code : str , redirect_uri : Optional [ str ] = None , ** kwargs
14661466 ) -> Union [Future , SlackResponse ]:
14671467 """Exchanges a temporary OAuth verifier code for an access token.
14681468
14691469 Args:
14701470 client_id (str): Issued when you created your application. e.g. '4b39e9-752c4'
14711471 client_secret (str): Issued when you created your application. e.g. '33fea0113f5b1'
14721472 code (str): The code param returned via the OAuth callback. e.g. 'ccdaa72ad'
1473+ redirect_uri (optional str): Must match the originally submitted URI (if one was sent). e.g. 'https://example.com'
14731474 """
1475+ if redirect_uri is not None :
1476+ kwargs .update ({"redirect_uri" : redirect_uri })
14741477 kwargs .update ({"code" : code })
14751478 return self .api_call (
14761479 "oauth.v2.access" ,
@@ -1479,15 +1482,18 @@ def oauth_v2_access(
14791482 )
14801483
14811484 def oauth_access (
1482- self , * , client_id : str , client_secret : str , code : str , ** kwargs
1485+ self , * , client_id : str , client_secret : str , code : str , redirect_uri : Optional [ str ] = None , ** kwargs
14831486 ) -> Union [Future , SlackResponse ]:
14841487 """Exchanges a temporary OAuth verifier code for an access token.
14851488
14861489 Args:
14871490 client_id (str): Issued when you created your application. e.g. '4b39e9-752c4'
14881491 client_secret (str): Issued when you created your application. e.g. '33fea0113f5b1'
14891492 code (str): The code param returned via the OAuth callback. e.g. 'ccdaa72ad'
1493+ redirect_uri (optional str): Must match the originally submitted URI (if one was sent). e.g. 'https://example.com'
14901494 """
1495+ if redirect_uri is not None :
1496+ kwargs .update ({"redirect_uri" : redirect_uri })
14911497 kwargs .update ({"code" : code })
14921498 return self .api_call (
14931499 "oauth.access" ,
0 commit comments