Forum Academy Marketplace Showcase Pricing Features

😢 [Still-Needed] How would i get a #token= for say as its not a ? parameter

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

I STILL NEED HELP ABOVE^

PLEASE NOTE ABUSING MY DISCORD INVITES WILL GET YOU INSTANT BANNED EXAMPLE RIGHT AFTER I POSTED THE ABOVE QUESTION And you will be reported for spam if you attempt this BS i just need help with my site not your advertising :poop:

A simple forum search would’ve helped you.

2 Likes

your not understanding the question at hand tho still cant login user with this form of oauth thanks tho for the tip m8

this only helps half the issue at hand i do thank you but the issue now is i have users double logging in i need to figure out a way to setup oauth to provide back access_token but also login the said user as well

other then this that really sums this whole issue up

im not a strong api suit but am needing this done and im so close im very proud of myself actualy so please dont down me but saying as well “Could of done a simple search in the forum” m8 i did try and tbh wasnt coming around anything im a visual person and sorry that my mental health seems to be a issue for you disabling me from reading nor writing very well hence no-code as i do have amazing ideas in hand and am a visual person by trait just please understand your comments like that can effect a persons mental health more so

Not sure what any of that has to do with anything. Your title is asking on how to grab the token from the url. I said forum search would give the answer. And it did. Then linked the answer.

1 Like