How to implement Google authentication using Xamarin.Forms? - xaml

I am developing a login feature in that user can login into the application using the Google account and get user profile detail. For that, I am creating a project in google developers and it's verified by me.
I try with this reference here but when I try with this that is give me the error of "Disallowed user agent" and gives me the error of the open in safari or chrome when I try with the iPhone(iOS devices).
I also go through some other references like "Xamarin. Auth" but it doesn't work for me. When I set a redirection URL with clientId:/oauth2redirect or the Package Name(Bundle Identifier):/oauth2redirect . It gives me an exception of Not valid redirect Uri.
I also try to add JSON and p12 file on respective device-specific projects and set bundle resource but it doesn't work me.
If anyone has solution to this without using WebView than help me.

You can try this plugin from CroosGeeks
https://github.com/CrossGeeks/GoogleClientPlugin
Here is the sample app:
https://github.com/CrossGeeks/GoogleClientPlugin/tree/master/GoogleClient/GoogleClientSample
This is not using the WebView. The documentation is also quite good.

Related

Redirect Uri is not working in react native for msal

I have a react-native app in which I am trying to move to msal from adal using the react-native-app-auth library in which finally after authentication I am getting this window that "Only continue if you downloaded the app from a store or website you trust", as clicking any button does not work, I found one issue related (Desktop app + Microsoft Authentication Error) but there is also no solution provided there too and I have tried with the HTTP:// URLs too.
So, did any one of you faced the same issue, so please help in the resolution. The final window I am getting
According to your follow-up comment I notice that you are facing redirect URL issue. In Redirect URI, select Web and type /.auth/login/aad/callback.
For example:https://contoso.azurewebsites.net/.auth/login/aad/callback.
Follow these steps and ensure all steps are followed.
https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad#-create-an-app-registration-in-azure-ad-for-your-app-service-app
Enable Azure active directory in you App Service app.
https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad#-enable-azure-active-directory-in-your-app-service-app

Issue saving informations in OAuth consent screen

I' ve created a new AoG project and then I've enabled API from Google API console. To complete this I have to add informations in OAuth consent screen but I'm having the same error from days: "Failure to save" without explaination about it. I've tried both to add all the informations and only the few required (name and emails) but it still doesn't work. Someone have the same issue? Solutions?
I don't know for sure, but try changing the application name. I was trying to create an OAuth consent screen and it failed many times with the same error as you. I was trying to name the project "Google Play Console" and it failed. I then tried "google-play-console" and it still failed. Then I tried just "play-console" and it succeeded. I think some words are not allowed, like "google".
There was a Google service error, not depending on me. After few days everything was fine!

NoCommerce 3.80 External Login Plugins

I am new to NopCommerce as well as C# MVC. I am working on NopCommerce 3.80.
As per Instructions I downloaded Google+ Plugin from NopCommerce Official site and Installed it and also configured it.
But when i click on Login with google button, it shows an error of
Google OAuth 2 authorization - Error: redirect_uri_mismatch
Can anybody help me to solve this ?
And another Question is do I have to create a Class Library for the External Authentication as like Facebook(Inbuilt Plugin) ??
The redirect URI that you entered in Google developer console must exactly match the location you are trying to authenticate from this includes the port number I can see in your message.
I don't know enough about nop to tell you if you could use the Google .net client library for your application.
I got the solution.
I haven't given correct callback URL that's why it's showing redirect_uri_mismatch error.
the URL I added is
"localhost:15536/plugins/externalauthGoogle/logincallback/"

Jhipster social login via Google

I added clientID and clientSecret (created in Google Developer console) to application.yml but I couldn't get it working. Any idea what is causing error 400. Error: redirect_uri_mismatch. I got http://127.0.0.1:8080 in Authorized JavaScript origins.
I did everything what is said in Google's tutorial, but no luck:
https://developers.google.com/identity/sign-in/web/server-side-flow#step_1_create_a_client_id_and_client_secret
You need to specify in your Google developers console the different redirect url you authorize. For you, you need to add http://127.0.0.1:8080 url.
Little tuto:
Connect to your developer console, click one the main menu
Select API management
Go to Identifiant and select your application, here JHipster
And add your url and save
Another thing that I had to do that wasn't mentioned clearly in the google developer link was to enable the Google+ API.
The various API's are accessible via the Library tab under the Dashboard.

Google Developer Console's credential side permission

I got an problem after i create and APIs on Google Developer Console and enable the GCM service,
but i want to add an server key at Credential next to APIs on left hand menu.
But it show me You do not have sufficient permissions to view this page.
Below are the image:
Is that any config i need to add?
I did follow what You do not have sufficient permissions to view this page to clear cache and use incognito mode to login, but still not work.
EDIT
Some time i relogin it work back, when i click to another side and click back it show the error again, and my solution is go to Credential than use top right corner account to logout and relogin , let it redirect you back to Credential, than it work. So is there any solution to fixed it permanently without relogin?
Thanks
It because of you have logged in multiple devices. so u have to log out from all devices. to do this go to gmail.com and log in using your email and password. and scroll down . you can see Details link . Click that link.
it will open new window. there u click
Sign out all other web sessions. than clear history. than do login and try . it will open without showing error.
I got the same problem. After following the below steps it got solved. This may help you as well.
Click on Apis under Api & auth
Click on "Google Play Game Services".
Enable the service.
Optional: enable "Google Play Developer API" as well. Most of the time it will enable by default.
I am facing the same issues.
Try using another browser like firefox - sometimes it works.
but after awhile, same error pops up.
Having the same issue as with you regardless what api i enable.. have tried all the suggestion posted earlier. but none of them worked, but when i tried to change my i.p.. using a vpn. and tried to access it.it worked, i can create or view my api now,tested it with other gmail account to confirm and started from scratch. to my surprise i didnt encounter that issue im having for hours.. no idea why my i.p is being rejected when accessing the credentials area..
I've resolve my issue, it's about the ISP you are using. I tried 3 ISP's and 1 of them got a success all the time, I don't have any permission error.