I have this code in order to get the email
string code = Request.QueryString["code"];
if (!string.IsNullOrEmpty(code)){
string data = FaceBookConnect.Fetch(code, "me");
FaceBookUser faceBookUser = new JavaScriptSerializer().Deserialize<FaceBookUser>(data);
And on the click event I defined this:
FaceBookConnect.Authorize("email", Request.Url.AbsoluteUri.Split('?')[0]);
The problem is that it gives me a null value as email, i tried doing the same for the name and it is the only field that actually works. I read that thay have changed the version to v2.6 and it is necessary to do the facebookConnect.Fetch in another way, but I am unable to find how. Anyone knows something? Thanks everyone!
Have you requested the email info from Facebook? You must do that at start of login and the user has to approve this before Facebook will provide it. Facebook also says it will be null if the address is not valid or if they used a phone number to sign up:
"Note, even if you request the email permission it is not guaranteed you will get an email address. For example, if someone signed up for Facebook with a phone number instead of an email address, the email field may be empty."
https://developers.facebook.com/docs/facebook-login/permissions#reference-email
Related
I want to simply get in my code if the user has his email confirmed or not. Without an async method. Can someone help me please?
Couple of options, if i understood your question correctly:
In your database add another 2 columns "EmailConfirmationID" perhaps of type GUID (UniqueIdentifier) and Verified (bit). When the user registers you can insert a new value into EmailConfirmationID send this link to the user (creating a URL) via email. When they click this link within the email you would have the page handle their request and set Verified to true.
Have a look at this link http://www.asp.net/identity/overview/features-api/account-confirmation-and-password-recovery-with-aspnet-identity
I downloaded and setup the example,I uncommented the following in the code.
static public string[] SCOPES = { PlusService.Scope.PlusLogin, PlusService.Scope.UserinfoEmail };
It retrieves my name, friend etc but it does not retrieve my email address.
Is anyone able to assist? Possibly i'm looking in the incorrect place.
I used tested it using Try It. I tested it with all of the different scopes
https://www.googleapis.com/auth/plus.login Know your basic profile
info and list of people in your circles.
https://www.googleapis.com/auth/plus.me Know who you are on Google
https://www.googleapis.com/auth/userinfo.email View your email address
https://www.googleapis.com/auth/userinfo.profile View basic
information about your account
It doesn't appear to matter you get back the email in all of the scopes. But what does matter is that the Users email must be set to public in the Account. If its set to anything else, your circles, only you. its not listed. This appears to be true even when you are trying to see your own information. (Sending Me)
I have programatically created a user in Active Directory. I want to set that user's email. I used the following code to set email address in active directory:
UserDirectoryEntry.Properties["mail"].Value = "john#gmail.com";
UserDirectoryEntry.CommitChanges();
At this point, the email address gets set in active directory properly. But the moment, i try to update another property for that user say for eg:
UserDirectoryEntry.Properties["telephoneNumber"].value = "022-2345678";
UserDirectoryEntry.CommitChanges();
After this point, the email address that we set earlier to "mail" field gets replaced with SamAccountName#domainName.com.
Can you please tell me why the email address is getting replaced with SamAccountName#domainName.com even if i have set it to "john#gmail.com".
I m using APIs of Active Directory.
I do not know if this works for you, but you can try adding the email instead of setting it:
UserDirectoryEntry.Properties["mail"].Add("john#gmail.com");
You will be still able to find the user bu this email.
What i want to do is when we click on Reply button , the From address field will be populate with the email-id (default team's default queue's email-id). Current scenario is populated with logged in user.
You can create script which will be executed onLoad of email form. Check is it 'Replay' action (Url will contain _InReplyToId parameter). Find queue from original email using his GUID from url, and set it to From field.
EDIT:
This example will solve your problem :)
I am developing a site where users can buy features using paypal. If user's paypal email is different from the email stored in our site how can i get notified about the user's payment via IPN?
You tagged your question with C#, so I'm assuming you're developing an ASP.NET site. And in the absence of more specific information, I'm going to assume you're using the default SqlMembershipProvider for your site.
So, to identify your user, you should probably use the ProviderUserKey property of the MembershipUser object. Use the following code to get the ProviderUserKey for your currently logged-in user:
MembershipUser currentUser = Membership.GetUser();
string userId = currentUser.ProviderUserKey.ToString();
Once you have a String containing the ProviderUserKey, you can pass it to PayPal using the custom HTML variable in your form:
<input type="hidden" name="custom" value="<%=userId%>"/>
When PayPal send the IPN message, it will send back the value that you set for the custom HTML variable. You can get the value from Response.Form and get the corresponding user:
object userId = Request.Form["custom"];
MembershipUser user = Membership.GetUser(userId);
Hope this helps!
You need to use the email of the user (the one which he/she used for your website) as an identifier.
When the user pays you, your website needs to send this email to Paypal as a "custom" field, and Paypal will send it back to you, among other IPN notification parameters.