How to add new 'authorized redirect uris' and 'Authorized JavaScript origins' using PHP? - credentials

I have project with login function via google's account. To do this, I had to created Credentials for my application. After that, I add new Authorized JavaScript origins is my domain name, and authorized redirect uris is my url to function login with google, all of them is in Client ID for Web application tab.
When I setup my application in new domain, I have to type new domain and new uri into google console.
Now, I make my application setup in a new domain automatically, everything is ok. But I can't use login function via google, because I don't register new domain in google console. So I want to add new 'authorized redirect uris' and 'Authorized JavaScript origins' automatically when I setup my application.
My application is written by PHP. Anyone, who can help me? THANKS?

Related

How to add Azure static web app URL to the Google OAuth 2.0 client ID redirect URL at Google developer console

I have created an Azure static web app with the default URL we usually get when it is deployed(eg: https://xxx.1.azurestaticapps.net).
I have created a login with google functionality in my app and locally it works fine. But when I try to add the static web app URL as a redirect URL at the Google developer console, under OAuth 2.0 client ID, it seems that it does not allow me to add the particular URL.
It just shows an error saying that an error occurred!
Does anybody know why this happens?

cannot load url error in facebook login using node in localhost

I know there are lot of posts and blogs regarding this error but most of the answers were related to the wrong url in the OAuth Redirect URIs and have tried all of them.
Currently I trying to login with facebook on my localhost only.
any help would be appreciated as I am struck here for a long time.
finally i was able to resolve it. I added the test app by clicking on the option button of the my app and then creating test app for it.
In oauth2 (google, facebook, linkedin, etc) there are 2 parameters that need to be configured:
domain or origin
redirect or callback
In Facebook App Settings we have:
App Domain (Your problem)
sample: acme.com
The domain should be without "https" or "www" or "subdomain":
Site URL
sample: http://acme.com/
OAuth redirect URI
sample: http://acme.com/auth/facebook/callback
/auth/facebook/callback must be a route in your nodejs express.
Advice
Review char by char the explained values in your facebook configuration page.
Source
https://help.sharetribe.com/en/articles/1317484-how-to-solve-the-can-t-load-url-the-domain-of-this-url-isn-t-included-in-the-app-s-domains-facebook-login-error
Facebook OAuth "The domain of this URL isn't included in the app's domain"

How can I get the Pinterest API to accept my redirect URL?

I am trying to build an app in node.js that connects to Pinterest via its API. I can get an access token via Postman and test my app in single-user mode, but I am unable to incorporate OAuth2 to test my app for a second user. Every configuration of my code and settings at developer.pinterest.com yields the error "The provided redirect_uri ... does not match any of my registered redirect URIs."
I registered what I believe are correct callback URLs at developers.pinterest.com--many variants, with and without trailing slashes. My callback is hosted via https.
I tried calling Pinterest's auth URLs OAuth2 in my server code (node.js), and via browser address bar.
https://api.pinterest.com/oauth/?response_type=code&redirect_uri=https://www.outfinterest.com/auth/pinterest/callback/&client_id=5042375080944909391&scope=read_public&state=true
I attempted the auth from a browser logged into Pinterest as me, and from a browser logged in as a registered tester of my app.
What must I do to get Pinterest to accept my callback URL?
Do I need to submit my app for approval before I can authorize via OAuth2?
I resolved the problem by reducing the set URLs registered at developer.pinterest.com to just the one I need, then reloaded the page with the app settings.

"Request cannot be processed" when using JHipster Google Social Login

I am trying to add the social login with google feature to a newly generated JHipster application. I have configured a google project with the client id and client secret and added the correct urls and redirect urls. I have added the 'signin' to the webpack.dev.js server configuration. This is what is currently happening:
After I select which account I want to use to log in with google I am redirected to a page that says "Your request cannot be processed" with the following url "http://localhost:9060/signin?error=provider#".
Am I missing something?

Google API using Oauth for internal company use only

I've created a web application using Node.js that relies on a google API (specifically the DCM/DFA reporting API). It redirects the user to login to their gmail account, and after a successful login redirects back to the web application.
Suddenly my company has told me that this web application needs to be restricted to internal use only, and that they won't host it on a public domain for security reasons.
Is there any way to get Oauth to redirect to the internal domain? When I try to set the redirect domain in the google developers console I get an error message that it is not valid. Is there anyway around this?
The sample redirect url you can add at Console and Code is:
http://localhost:8080/authcallback
(Remember to not add trailing / in url)

Resources