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

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?

Related

Why am i getting error redirect url mismatch when trying to login with social media?

I tryied to develop social media login with google and facebook for my web app.
App developed in nestjs, deployed with nginx.
Before deployment i tested my app at localhost, so at google console and fb app i have url and redirect url. It was sometyhing like this:
http://localhost:3000 - url
http://localhost:3000/api/auth/redirect/google - redirect url.
At localhost all worked correctly, but when i deployed my app to the server i changed localhost to the domain. So now at google and fb i have something like that:
```https://sub.domain.com - url```
```https://sub.domain.com/api/auth/redirect/google - redirect url```
But nothing works. At both services i have redirect url mismatch error. I waited about 20 hours, but nothing happend
Then i tried to delete my app from google, create new and replace GOOGLE_CLIENT_ID and GOOGLE_SECRET, but i still have prev error.
Please help me crying
My App API
Facebook Settings
Google settings

React-Native authentication with a server using Azure AD

I am trying to authenticate to a server from my React-Native app using Azure AD.
Now, I don't understand what is a redirect URI and I don't understand where should I put my server's URL in Azure and what URL should I call from my React-Native app.
Documentation for it is quite confusing.
I don't understand what is a redirect URI
For React-Native app, the redirect_url is optional. Refer to this document for more details.
An url that ADLoginView will be redirect when login success, this property is optional.
I don't understand where should I put my server's URL in Azure and
what URL should I call from my React-Native app.
You needn't put your server's url in Azure.But you need to add authentication to your server. Then you can call your server api as normal, but with the Authorization header. This sample will help you to understand better though it is using aspnetcore.
You need to create register two applications in Azure portal. Client app and server app. You will get the access token via your native app and then use it to access your server app.

Cannot redirect the response to my controller after publishing the project in azure : AuthBot

I'm trying to create a bot in which the user has to first log in with his microsoft account, for that i created an app in Azure Active Directory that returns to my controller the access tokens (redirect URL). So, a fixed the redirect URL to my controller in this app as :
http://localhost:3984/api/OAuthCallback
And it works just fine locally, i get locally the response from the AAD App to my controller. However after publishing my project in azure this doesn't work because the project is no longer in localhost and the redirection response to my controller does no longer work.
Can someone help me please ? WHat redirect URL can i add to my AAD app in order to redirect the response to my controller in Azure ?
This is the AuthBot that i'm talking about :
https://github.com/Ellerbach/SharePointBot/tree/master/AuthBot
You just have to add another redirect URL in the AAD App that redirect to your azure controller, in my case it's something like this :
https://*****.azurewebsites.net/api/OAuthCallback
Firstly please consider using Botauth and not Authbot as the Authbot project has been discontinued and is not updated to the latest bot framework changes.
Secondly, as you said, add your bot (hosted in Azure) url followed by /Callback i.e https://*****.azurewebsites.net/Callback to the redirect url of your Azure Active Directory app when you use AuthBot.

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)

using Azure Mobile App for Google authentication

I follow this tutorial for Google authentication for my web application.
I specified the following in my Google Developers Console:
Authorized JavaScript origins = my Azure mobile app url
Authorized redirect URIs = my web app url + /.auth/login/google/callback
But in this case I get the following error:
That’s an error.
Error: redirect_uri_mismatch
The redirect URI in the request:
mobile app url + .auth/login/google/callback did
not match a registered redirect URI.
If I use url of my mobile app instead of web app url for Authorized redirect URIs, it work, but not redirected to my web site.
How I can specify different urls for Authorized JavaScript origins and Authorized redirect URIs?
You are likely running into the External Redirect URIs based on your Hosted comment. Check out the authentication section of the developer guide here: https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-cordova-how-to-use-client-library/#auth - the last section is on updating CORS and the external redirect URIs.

Resources