how would I get a #access_token=
for say as its not a ?
parameter I’ve tried get data from url but it dosnt work heres the issue at hand i need to use a Implicit Grant for discord which is one url can be found here Discord Developer Portal the url would look like this for say > https://discord.com/api/oauth2/authorize?response_type=token&client_id=891335306681384962&state=15773059ghq9183habn&scope=identify
this url would then bring said user to a authentication page provided by discord this would provide a url back like so https://dislist.me/api/1.1/oauth_redirect#token_type=Bearer&access_token=TOKEN_REMOVED_FOR_SECURITY&expires_in=604800&scope=identify&state=15773059ghq9183habn
I’ve tried many ways to get this to work see I have users login via https://dislist.me/version-test/login
Log in for say this thus makes said user login to threw discord but only gives back a ?code=their_temp_code
this code i tried to make a plugin to perform this client-credentials-grant call found here (but i can not for life of me get it to work in bubble right) Discord Developer Portal
Mind you i did get it working but to pass this off from the the users saved ?code=
wont work as it already expired
import base64
import requests
API_ENDPOINT = 'https://discord.com/api/'
CLIENT_ID = '332269999912132097'
CLIENT_SECRET = '937it3ow87i4ery69876wqire'
def get_token():
data = {
'grant_type': 'client_credentials',
'scope': 'identify connections'
}
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
r = requests.post('%s/oauth2/token' % API_ENDPOINT, data=data, headers=headers, auth=(CLIENT_ID, CLIENT_SECRET))
r.raise_for_status()
return r.json()
So the main issue at hand is obtaining a #access_token=
of a user to store temporarily to then add the user into my guild but the halt of the issue is i would need to redirect a user to a external_url=
https://discord.com/api/oauth2/authorize?response_type=token&client_id=891335306681384962&state=15773059ghq9183habn&scope=identify
But When this action needs to be performed last on a page after a user clicks a url and if i was to put anything prior to capture that token … well it just wont work data wise like trying to save data to current user in a DB field for say
temp.access.token=get_data_from_url
Using > parameter
then using access_token
as the set parameter
does not work
Please note helping me is also helping broaden the span of bubble.io its self by allowing users of no code experience to use bubble to Develop there own Discord Styled sites with my plugins so far DisList.Me Contributor Profile | Bubble to boot
I’ve been stuck on this issue for 7 days now and have gotten NO REPLYS of anything help related