Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
3,253 additions
and
15,979 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Zain,
I did exactly what you described. On the Facebook login page, I gave permission to use my email. However, I still don't get my email from Facebook. I just get Id and Name claims.
info.ExternalPrincipal.FindFirstValue(ClaimTypes.Email) returns null.
Any idea/suggestion?
Thanks.
Dilip Kumar
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Dilip,
I take it you made the changes in this checkin (the "client.get("me"...) part), right?
If you put a breakpoint on that line, what does the info object returned by the FacebookClient contain?
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, can you try this:
Clone this repository, try syncing it to this change list, add your facebook secrets to it, and try running it. See if you get the email address then. That'll at least help tell if the problem is in your code or if it's something about how facebook is configured.
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I don't know how to "clone" and "sync". I haven't done it before. Any suggestion is appreciated.
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you pretty new to using git/github? if so, no worries, we're all noobs at some point. I'm curious, how much programming do you know and what are you trying to learn/do?
Cloning a repository
To clone a repo/code base means to make a copy of it. You can easily clone any github repo (short for code repository) by going to the project page (in this case https://github.com/ZainRizvi/ASP.NET-Core-FacebookAuth) and looking for the https://github.com/[repository] link.
In your case it'll look like this (there's even a handy copy to clipboard button on the right side):
Then you open up a command window on your computer, navigate to a folder where you want to save the copied the code to, and run
git clone <repository link>
.Here, it would be
git clone https://github.com/ZainRizvi/ASP.NET-Core-FacebookAuth.git
That'll create a folder ASP.NET-Core-FacebookAuth with all the code in it.
Syncing to a specific commit
Now to sync your code to this commit cd to the ASP.NET-Core-FacebookAuth directory. There run
git reset --soft <commit number>
.You can find the commit number at the top of this page (it's f771c75). So you'll run
git reset --soft f771c75cc89691504a04e9b5b985428998002f8e
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, you can even "fork" my code (which here means make your own online copy of it on github) by again navigating to the project's root directory at https://github.com/ZainRizvi/ASP.NET-Core-FacebookAuth and clicking the "Fork" button on the top right corner:
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @DilipK01, did you have any luck following the steps?
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dilip, were you able to get it to work?
Just so you know, none of your screen shots show up. If you want to attach a picture can you try doing it in the github conversation directly rather than by replying to the email github sends you?
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Zain,
Finally, I was able to successfully run your project on my machine. However, I still don’t get my email from Facebook. The screenshot at the break-point is attached herewith.
I really appreciate your help and guidance.
Dilip Kumar
f771c75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if you didn't authorize Facebook to give your app your email address when you first logged on.
I'd suggest going to Facebook, go to the security settings, delete your app from the authorized apps list, and then try registering your facebook account from within your app once again. That'll invoke Facebook's "Allow xxx app access to your info?" flow again, and this time it'll get access to your email address I'd everything is setup correctly