Currently I have a very simple google authentication built-in from ASP.NET website wizard using Microsoft.AspNet.Membership.OpenAuth
with just a single code line in AuthConfig.cs file
OpenAuth.AuthenticationClients.AddGoogle();
and now I get an error from google
OpenID auth request contains an unregistered domain
The problem is that I don't know how to update the website to support the new authentication method, I got an api key from google, but the OpenAuth.AuthenticationClients.AddGoogle does not support parameters like the function for Facebook or twitter authentication.
If you are using OpenID2 in your code, the problem could occur because Google has disabled OpenID2 for new domains.
Related
I used the following article to implement google authentication in my asp.net web api project. I followed the article and created a sample application. Now I have a simple test, as follow, but I am unable to proceed further
I hit the URL /api/Login/ExternalLogin in browser
It redirects me to google authentication page, where I login to google
It redirects me back to api/home (again API url), where I compare google returned identity in my local database.
But my confusion starts here,
How can I use these API URLs in my angularJs application? If I hit api/Login/ExternalLogin in angular service, it will return me response of google authentication page?
How can I redirect browser if authentication from google is needed? What flow can I follow? Please help me, I am new to this concept.
I'm trying to authenticate my app users with their credentials used at the website
I managed to authenticate users via Xamarin.Auth to login via Google, Twitter... etc but could not figure out how to authenticate them via ASP.Net Identity provider.
any ideas or examples ?
Your problem is not a new one, and is one that will be easily fixed in the near future (see note below).
When you're authenticating with a provider like Google or Facebook, you're receiving a token that you can then use to send to the API. Unfortunately Asp.Net Identity does not do this out of the box. You can either configure your API to use JwtBearer tokens, or check out the Identity4 project along with their samples. Note that if you're using Asp.Net Identity you'll probably want a cross between Quickstart 6 and Quickstart 8 so that all of the necessary persistent stores are in your database.
NOTE: You might also want to follow the Templating Team's PR #700 which is adding token based auth in the new templates which will soon allow you to rapidly create new Api's with Token Based Authentication for your mobile apps.
As i am new to react native stuck at one point.
I am developing an app in which i am using wordpress as a backend to store the new users data.
To Create a new user i need authentication as i am using wp rest api plugin to create user.
For authentication i have used Oauth Server plugin in wordpress admin.
Now issue is as per the Oauth documentation i need to get the authentication code in my app.
So want to know how to redirect_uri to our react-native app so that i can get authorization code in app?
To get authorization code in react-native app, You need to set the custom Url scheme.
twitter has well documented guide to create it.
https://dev.twitter.com/cards/mobile/url-schemes
After creating the Url scheme. You need to set the redirect_uri as explained here in wp-oauth server's docs Step 2 and replace the created custom url of your app in redirect_uri.
This will redirect you to your app when oauth server's callback with the access token that you can use in your react-native application.
I am looking for a good example for the Facebook C# SDK authorization flow. I am upgrading to version 6 of the SDK and I am having trouble understanding the new flow. I am using the following components:
Asp.net MVC3 Web application
Facebook C# SDK v6
FB Javascript SDK
I am trying to pass the access_token from the FB Javascript SDK to the server for further use.
This flow is outlined in the new documentation at:
http://csharpsdk.org/docs/web/getting-started
I have a the following questions:
Why are they passing the access token in a post vs parsing it out of the cookie.
Don't we need to verify the signed request at the server side before trusting the access token?
First you to have to Follow the conventions that Facebook Javascript SDK is giving to work it with C# SDK.
Answers.
1. Javascript SDK need post back of the page after login in to Facebook. You thoughts are right about getting token from cookie but think what if cookie is disable on browser? Posting access token is the best choice in both cases.
2.Access token already encrypted by Facebook so you dont need to worry about them. If you want more security then you enable encrypted access token in you app settings.
See http://developers.facebook.com/blog/post/572/.
Another thing is that if somehow somebody pass the invalid access token(XSS attack) in post back then also you don't need to worry because access token is validated on Graph API servers, so there less possibilities to effect your Facebook account. You can also enable HTTPS of site to make it more secure.
That's all what I have.
Thanks
Happy Socializing.. ;)
Dharmendra.
I am trying to implement OpenId for an internal web app. Our college is on Google Apps for Edu, so we have the suite of Google OpenID and OAuth exposed to us.
I would like my login page to have the standard username and password, and additionally a button on the side that will authenticate internal users to our app domain.
I have followed the example here http://www.dotnetopenauth.net/developers/code-snippets/programmatic-openid-relying-party/ but it seems that the rules are different for the google apps id than a general google id.
Any help or further documentation would be helpful.
I have the same problem as you.
For your Google Apps login, your relying party URL is https://www.google.com/accounts/o8/site-xrds?hd=example.comsite-xrds?hd=example.com
Where you replace example.com with your URL.
However, As far as I can tell, dotnetopenauth does not handle the protocol extensions google uses when it returns.
However, using https://www.google.com/accounts/o8/id works perfectly fine.
Using this url, you pass off users to Google to login. Google will check for cookies and prompt for a login if required. if not it'll just confirm with the user that they want to associate their authentication with this site and pass you back.
Still trying to get dotnetopenauth to accept the new url: https://www.google.com/accounts/o8/site-xrds?hd=example.com