after I did some research on the subject, I found that Windows Live stopped providing email addresses for a user's contacts through its API. Instead, they provide the email hashes.
I did a little more research, and i found many websites being able to retrieve the contact list for a user and displaying it (with emails, not hashes) but the difference is that i don't think they are using oAuth since to retrieve the emails, the user must provide his email/password.
I need to implement importing a user's contact list on my site and i see no workaround to doing it using oAuth REST requests through Live's API (granted that i was being able to get the access token and make other REST requests).
If not using oAuth, what are other ways of getting a Windows Live/Hotmail contact list?
I ended up using Windows Live ID's Delegated Authentication. Even tho it's deprecated it'll have to do until i find a more effective solution.
Related
I have a web app (rest API) on azure, and I have a B2C setup that is securing it, requiring you to be signed in to access the API. This is good, as i wanted the API to be restricted to members. Basically, the entire web app requires authentication, and will prompt you for a sign in.
Heres the problem - my app has users (who have accounts) and clients (who do not have accounts). These clients might receive an email about a new appointment being set up with one of the users - this email should have one or more links/buttons (ie, a button to Confirm appointment, one to Decline, and one to request a reschdeule) and upon clicking this link I would like to update a field in my database via the rest api, so the USER knows the CLIENT's response. The trouble is, since the client wont have an account, I have no idea how I can give them a link they would be allowed to go to, and have the update happen.
I have tried to do a bunch of research - ive looked into AD external identities with a one time passcode - but i cant seem to find any info on how i would actually get this to work for my purposes.
Does anyone know how I might implement this in azure? Is there a way to call to azure form c# to generate a one time authentication that i can encode into a URL or something?
Any thoughts would be greatly appreciated.
Thanks!
You could do an anonymous authentication by using a magic link. The users account won’t even need to live in the directory. The link can be short lived, and potentially one time use. We call it id_token_hint or a magic link.
Sample here
https://github.com/azure-ad-b2c/samples/tree/master/policies/invite
And reference here
https://learn.microsoft.com/en-us/azure/active-directory-b2c/id-token-hint
Does anyone know how I can send an email via my webserver (Azure Functions) to gmail?
This is for clients to contact us through a website so it needs to be frictionless and without a challenge.
I have followed this guide
https://developers.google.com/gmail/api/quickstart/dotnet?authuser=1
After creating my own implementation of IDataStore for Azure, I have painfully realised that this will try to challenge via the web browser.
We previously had this working using SMTP using similar method to this
How to send email by using MailKit?
but this requires us to set the 'Allow Un-secure Apps' flag which after a period of time automatically switches off and causes our contact us page to stop working.
I guess this should be possible using an API key which I have created but I can't find any documentation on how to send an email using just the API Key.
Gmail api route using google .net client library.
If you are using a gsuite domain email address then you can use a service account. Let me know if you need some code for this.
Otherwise you will need to run your code once locally authorize it stave the refresh token then set up your Idatastore to use the refresh token that you pass to it. As long as the refresh token is used regularly it shouldnt expire. Thats not saying it cant but it shouldnt it will need to be babysat a little if it fails just generate a new refresh token for it and it will be up and running again.
smtp route
if you want to use smtp your probably going to have to work out Xoauth2 I am not aware of anything out of the box for C# that works with that and the Google .net client library does not work with the smpt server.
I don't even know what to look for. I tried using the directory API to accomplish this however I was not lucky. I have a service account key created so that my console app (which will become a azure web job) doesn't have to approve any permissions...
Can someone help with direction? I just don't even know where to start...
Depends where you want to start. There are probably a few libraries that will emulate the IMAP or POP3 protocols for you.
However you can also code the following protocols fairly easily.
https://code.msdn.microsoft.com/windowsdesktop/Simple-IMAP-CLIENT-b249d2e6
This example should get you started for IMAP, and POP3 will follow similar protocols.
EDIT:
I misunderstood the question. I was looking at gmail groups and I think I understand what you're trying to do. Retrieving emails from a group isnt really possible as the emails aren't shared. All a gmail group is, is a distribution list which sends emails to all the attendees in the list.
What i would do now is create a new Gmail account, and add it to the work group and have it receive all the emails. Use the Google SDK or the self created protocol to retrieve all the messages manually from the message box.
I have a client that wants to use Windows Live ID Delegated Authentication SDK 1.2 to provide authentication for their website.
The architecture that they proposed was to have a database table that contained the email addresses of users who were authorized to use the site. Once the user logged using Windows Live ID web authentication, they wanted to compare the email address associated with that live ID to the table and allow/disallow the user access to the site based on that.
Is this possible? I can't find any documentation that talks about how to get the email address associated with the Windows Live ID.
I was originally looking for the way to do this with the Rest API, but it doesn't seem to work.
Using "wl.basics, wl.emails" solved the problem, albeit I don't have a fallback for when javascript is disabled.
Example from Rup:
http://isdk.dev.live.com/ISDK.aspx?category=Core+Concepts&index=1
I'm using the Facebook C# SDK for build an website with some facebook integration and I'm having some problems with getting the email from an facebook user.
I ask for these permissions:
email,user_birthday,user_about_me,user_relationships,publish_stream,offline_access,user_location
And when asking for fields I ask for these:
id,first_name,middle_name,last_name,picture,email,birthday,location,gender,friends,bio
This is allready live an in most cases there is no problem at all. But in some cases about 1/100 I don't get the email field but all the others fields are there.
Do any one know how this can happen?
I tested with different privacy settings and with multiple facebook accounts.
Ole Dallerup Sørensen
Just like you said, some people have their privacy settings set up so that Facebook proxies any emails to them. This means despite them granting you the permission you will still not get their email address.
I found an solution to my problem for now.
Instead of using the graph api I run an fql query and this gives me the email.
the fql:
SELECT email FROM user WHERE uid = me()