Client_ID value is now snowflake - oauth-2.0

I am trying to invite my Discord.js bot to a server but whenever I use the URL, it says CLIENT_ID "(my client ID is in here)" is not snowflake.
What does this mean, I've looked about but haven't seen any fixes to this problem. My redirect URI is https://discordapp.com/oauth2/authorize?&client_id=[CLIENTID]&scope=bot with CLIENTID as my client ID. I'm not fully sure on how to use a redirect URI properly, as for my other bot(in python) I didn't need it.

This appears to be an issue with the ID you substituted into the URL, double check the ID you provided is right and corresponds to the bot; if this turns up okay, I would recommend generating an invite URL through the Discord developer portal.
If you navigate to the Discord Developer Portal and click on the application you want to invite (your discord.js bot) it will open the application's page. From there click OAuth2 on the side panel then URL Generator and select the scopes and permissions you want for the bot and Discord will generate the URL for you.
On a side note, the programming library or language you use will have not affect on the invite link.

I had this same issue, for me it turns out my client id ended up having a semicolon at the end because Prettier auto-appended it to my .env file.
Try printing out your client ID and make sure it's just a string of numbers like this
CLIENT_ID = "123456789876543210"
with no other characters in it

Related

Discord bot failing OAuth2, "client_id missing"

Thank you for taking the time to help me.
So I've needed to change my bot's scopes for some planned updates that are about to be under development, but I can't start till I've re-invited the bot with the missing scopes.
Here's my invite link:
https://discord.com/api/oauth2/authorize?client_id=982594523584667679&permissions=0&redirect_uri=https%3A%2F%2Fdiscord.com%2Fapi%2Foauth2%2Fauthorize&response_type=code&scope=identify%20email%20guilds%20guilds.join%20guilds.members.read%20messages.read%20bot%20dm_channels.read
This invite URL was generated by Discord's Dev Portal. The error I'm getting is:
{"client_id": ["This field is required"]}
I'm failing to understand why it's not identifying the client ID from the URL when it is most definitely present. I've even used this link where I set the redirect_uri portion of the URL to include the client ID.

Discord OAuth2 redirect URI how-to

I'm trying to make a discord bot (with the bot tag) that can join other servers.
I will be able to do this, if I can set up a redirect URI for it. I already have the bot account set up, and it already functions with it (except for joining servers).
I was wondering how to set up a redirect URI for discord OAuth2?
To add your bot to a server you need to make a redirect url with your Client ID
Just replace the Client Id with your Client Id:
https://discordapp.com/oauth2/authorize?&client_id=[CLIENTID]&scope=bot
That's all! Now you just need to click on it!
You need to have your own webserver with some path to make your redirect url. For example, if you owned example.com, you could have example.com/discord be the url to redirect the client to after they login via Discord.
I'm assuming you are trying to use the guilds.join scope and it tells you to give a redirect URI. I think you are mistaking the guilds.join for the bot because it is actually the scope for letting your application join servers for the client (you can see this by going on the link https://discordapp.com/oauth2/authorize?&client_id=[CLIENTID]&scope=guilds.join and replace [CLIENTID] with the application client ID).
This means the link with the scope guilds.join will be on a website that you own and once the user either grants and denies this, the grant page will redirect the client back to the website.
Also, your bot cannot actually self-join servers simply because of how it was made. Bots must be manually authorized through OAuth. If you want a bot to join the server itself, it could use the invite link to get the server and DM the server owner (that can be found using the property) a OAuth link for the bot. Since the bot is not in the server it wants to join, you will need to do this method through the rest client. If you don't mind doing it like other bots, you can get the bot to provide the join link like other bots with a command like !invite.
Edit: If you want more information about using guilds.join, the documentation link is here: https://discordapp.com/developers/docs/resources/guild#add-guild-member

How to get client secret from Google Developers Console in iOS?

Currently i am working on one of old project within that there is a client id and client secret. Now i want to update those with new client id and client secret using another Developer account. I followed each and every step from
https://developers.google.com/+/mobile/ios/getting-started
Google APIs Console - missing client secret
But i can see only client id. Where is the client secret ?
Here i can see only client id
Hey this is step by step process ,hope this helps you...
Step 1:
Goto Google Developer console and create new app
Step 2:Enable the google plus api
You can see the enable api in the Enable API's tab which is next to API Library ,which is visible in second image.
Step 3: Goto to credential in API & auth tab then select credentials option
select the type of authentication you require
then you will can see the configure consent screen configure the page with the information you wish to provide .
Step 4: Select the web Application option on top
and enter required url's
and finally click create button
once you do that ..you can see ...client id and client secret key...
When in iOS, the application type of the OAuth credential should be 'iOS'.
And then you should pass an empty string as the client secret in your code.
Keeping a secret (that is global to the entire application, not unique per user) in an app is NEVER EVER secure. See https://developer.okta.com/blog/2019/01/22/oauth-api-keys-arent-safe-in-mobile-apps This is an amazing article, please spend as much time as needed to understand it.
Because it can't be kept secure, using client secret in iOS is the old, outdated approach. Nowadays you want to use proof-key-code-exchange (PKCE). It's also explained in above link, but in short:
Generate a secret key in iOS, it is one time use for that one specific login
Only send the hash of the key to the login authority (Google). The original has not left the app yet
To get the tokens, you send: <AuthorizationCode,ORIGINAL secret> AuthorizationCode is also a one time use
Google can compare the "original secret" to the previously sent hash. It therefore knows you are not an attacker that has stolen the AuthorizationCode
Back to the question. Google let's you create different types of "Apps":
Web application: Has a client secret (It's on a backend server, not on a publicly accessible iOS app)
iOS app: Has "iOS URL scheme" instead. There are frameworks that use this URL scheme and do the steps I described above for you (including PKCE). Disclaimer: I'm not an iOS developer, but I'm 99% certain

How to register a new consumer in JIRA?

I am trying to connect to JIRA using OAuth. I have followed this tutorial but when i want to create a new Application Link, it asks me to enter the URL of the application i want to link which seems strange in my case, since i want to connect a Google spreadsheet to JIRA !!!
I really appreciate your help Welsh, i have managed to generate a public key thanks to you and a new application link, now i want to obtain a request token from JIRA but i always get an error message when executing the request token command.
The document states:
When creating the Application Link use a placeholder URL or the correct URL to your client, if your client can be reached via HTTP and choose the Generic Application type.
So you can either use the URL to the Google Docs Spreadsheet that will be using the token to authenticate or you can just use a placeholder URL.

error:Redirect uri invalid for vimeo using oath in ios app

In my app I'm integrating OAuth2.0 library for vimeo upload. I'm getting error as invalid redirect uri after user log into his account.
My code,
self.oauthClient = [[LROAuth2Client alloc] initWithClientID:#"**** client ID ****"
secret:#" * secret * " redirectURL:[NSURL URLWithString:#"testMyApp://oauth"]];
In the plist i have given "testMyApp" as string in url schemes.
is this the right way to specify redirect uri? please help!
Your redirect url must 100% match the url configured on the developer site.
If your user is redirected to testMyApp://oauth your configured redirect url must be exactly testMyApp://oauth
The 3 pieces of information that you pass back to the Vimeo API (redirect_uri, code, grant_type) must be form URL encoded body parameters.
If they're being passed as query parameters, for example, the request will fail and return the error you're seeing.
For the Vimeo API to allow for your redirect, you have to register it for your app with the developer site. When it is registered there you are able to use it when you specify the redirect.
The plist scheme registration only notifies iOS that you can handle the scheme; Vimeo is unaware that it's a valid thing to redirect to for your app without this step.
The redirect url in the developer site must exactly match with the one in your application authentication request. I faced the same problem because of difference in the redirect url. But I fixed that and its working.
Developer site redirect url:
My app's request url:
https://api.vimeo.com/oauth/authorize?redirect_uri=vimeo608e5e6ffab5f7d2b567443f57684fdae8f8cb1c://auth&response_type=code&state=aee5252c-963c-4146-8358-a423326dd03c&scope=private%20public%20create%20edit%20delete%20interact&client_id=608e5e6ffab5f7d2b557443f57684fdae8f8cb1c
the value of the key redirect_url in above request is exact to the developer site. Please feel free to comment..
In my case, I had forgotten to enable implicit authentication and was getting the missing redirect_uri message.

Resources