box-python-sdk icon indicating copy to clipboard operation
box-python-sdk copied to clipboard

Pass a custom state instead of csrf_token during the Oauth2 process.

Open LesPrimus opened this issue 3 years ago • 1 comments

Hi

First off thanks for this library very helpful.

My question is: Is it possible to pass a custom state string, instead of the auto-generated one (csrf_token), during the Oauth2 process?

Like this:

oauth = OAuth2(
    client_id='YOUR_CLIENT_ID', 
    client_secret='YOUR_CLIENT_SECRET',
    store_tokens=your_store_tokens_callback_method
)
auth_url, csrf_token = oauth.get_authorization_url('http://YOUR_REDIRECT_URL', state=<custom_state>)

The doc here says otherwise.

LesPrimus avatar Apr 17 '21 06:04 LesPrimus

You can subclass the OAuth2 class and override its _get_csrf_token method to return whatever you want.

Jeff-Meadows avatar Apr 18 '21 17:04 Jeff-Meadows

This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.

stale[bot] avatar Dec 19 '22 20:12 stale[bot]

This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box Python SDK and feel free to open another PR/issue at any time.

stale[bot] avatar Dec 27 '22 06:12 stale[bot]

This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box Python SDK and feel free to open another PR/issue at any time.

stale[bot] avatar Jan 03 '23 09:01 stale[bot]