User Information when using external authentication in ASP .NET MVC 4 - facebook

I am using ASP .NET MVC and I have been successfully able to login using LinkedIn and Facebook. But inside ExternalLoginCallback() action, I have failed to retrieve user email when I login using LinkedIn (although I am getting other info like user name, job title etc)
Similarly with Facebook, I am not getting fields like job title in response.
Can anyone please help

You can use this link - http://mvcrocksonasp.net/OAuthWithMVC4 here is code for getting user information via linkedin, Its working fine.

Related

Outlook Graph API call from Sap ui5 Application web ide to Connect the outllok calender to Sap ui5 application

I am trying to call graph api so I had followed the procedure mentioned on the site. I had registerd the App in https://apps.dev.microsoft.com/portal/register-app
and got the client id and and then I am trying to make a ajaxs call url
"https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=XXXXbxxxxxxx-bf22-4bdb-bXX-cd32a729a31f&redirect_uri=https://webidetestingXXXXXX-XXXXXXXXXXX.dispatcher.int.sap.hana.ondemand.com/webapp/index.html&response_type=code&scope=openid+Mail.Read";
this always opens a login page and How can I pass the username and password after the call.
second-I call this url and enter the credentials it shows me an error of Microsoft account is experiencing technical problems. Please try again later.
Can you please guide me what i am missing or any example in sap ui5 environment to call such graph Api
this always opens a login page and How can I pass the username and password after the call.
When directing the user to the /authorize endpoint , microsoft server will show the login page to let user enter the username/password , after that you couldn't pass username/password to that in your own code .If you don't want to show the login page or need to use own login page , it is possible to sign in a user with the username and password flow as noted here. But that flow needs writing passwords for identity provider into your custom website , and you should check more at the Constraints & Limitations section .
I call this url and enter the credentials it shows me an error of Microsoft account is experiencing technical problems.
Please provide more details of that error , you could find error message in browser address bar like :https://login.live.com/err.srf?lc=1033#error=invalid_request&error_description=xxxxxxxxxx

How to link an email account to Facebook in Spring Social?

I have been some time trying to figure out how to solve this. Let me explain in detail to you.
I'm developing a web app in Spring MVC and Spring Social. By now, users can sigin and signup with Facebook, Twitter and with user/password. Even those users signedin with Facebook/Twitter are able to share.
Now, the webapp owner wants that any user signedup with user/password, he/she can link his/her active account with his/her Facebook profile. This way, those users can post on his/her Facebook wall.
Any of you have an idea about how to accomplish this?
By now, I have tried to get FB token through Graph API http link, but URL shows FB secret property.
Any ideas?
If i am understanding this correctly a very similar scenario is covered in the spring social sample project: https://github.com/spring-projects/spring-social-samples
Once a user is logged into your webapp
They would need to connect to Facebook via spring social (Spring social connect controller would handle this).
They would need to authorize your app to access their facebook.
(spring social does this), After the authentication process you obtain a key that you can keep for the next session.
Once they are logged in, you have an instance of Facebook Connection(spring-social-facebook creates this), and you can use it to post to their wall
connection.updateStatus("I've connected with the Spring Social Showcase!");
There are also other operations you can perform against the Facebook API.
Hope this helps answer your question.
Thanks,
Paul

Facebook authentication for both mobile & web app in Cakephp

Can anyone help me to overcome this hurdle..
My Situation:
I have a webapp (Facebook app) in cakephp, which will b accessed only after Facebook authentication(Its working cool).
& now I have a mobile app & which will work on restapi, I want the same above webapp code to be served as RestApi.
Now I'm able to do authentication for mobile app with facebook, I need to authenticate my webapp which will server as rest api(unless I cannot use the code inside the app)..
Requirement:
I have access_token & user_id with me sent by facebook to my mobile after successful login, & How can i authenticate my web app with these two..??
Can anyone look into this & help me to comeout..!!?
If you want to access Facebook data from inside CakePHP you have to send the access_token & user_id to CakePHP. You probably should narrow down your problem to a specific error or method that fails, here it's not really clear where your problem lies.

Use OAuthWebSecurity With MVC 3.0 with custom membership provider

I am looking for how can I implement OAuthWebSecurity with Mvc 3
I have a custom membership provider and I would like to add Facebook, Google and Twitter authentication to my website.
Authentication scenario using Facebook for example
1- the user chooses login using Facebook.
2- check Facebook authentication
3- if success --> check if the user exist in my database
4- if exist --> make the user logged in, if not create a new user in my custom user table
Please advice.
Please See Below Link It Give you Fully Information about it
http://www.asp.net/mvc/tutorials/security/using-oauth-providers-with-mvc
Here is a sample / template project which implements a custom membership provider based on the Entity Framework, it has custom DB schema, external login / signup functionality via Google, Twitter, Facebook...
https://github.com/kriasoft/site-sdk

Using socialoauth to get twitter/facebook data

I'm using socialoauth (http://code.google.com/p/socialoauth/) to implement twitter & facebook logins for a web site. The site is php and mysql based.
I've got logins implemented and working, but I need to get the users screen name or email so that I can store their preferences about my site in a mysql database. I'm not sure how to go about getting their information once I've got the oauth_token and oauth_secret. I couldn't find any documentation or examples using socialoauth, aside from getting the logins working.
I downloaded twitteroauth (https://github.com/abraham/twitteroauth), and mismashed that together with socialoauth.php via this tutorial (http://net.tutsplus.com/tutorials/php/how-to-authenticate-users-with-twitter-oauth/) and was able to get the twitter user's information, but I would prefer to use only socialoauth.php because it does logins for both facebook and twitter.
Specific question: does anyone know which functions in socialoauth are used to get the user's information (hopefully for both twitter and facebook)? I'm very new to this, so it's possible I saw the function I needed while I was looking through the code, and simply didn't recognize it as what I needed.
Twitter does not provide access to users email addresses. The users Twitter screen_name should be returned in the same request you get their access token however.
With Facebook you have to ask for the email permission and then their email address should be accessible with the profile details.