I have an application which I would like to integrate with my company's Office365 email through a single sign on.
Here is how I was thinking of doing it:
My application can take the email address and password (or username) which users have logged into it and pass it out to a web service (in this case a PHP page).
The PHP page takes the username and password and users them to sign into Office365 email.
The user is redirected to the email page.
We are using Office365 with a local Azure tenancy and local AD.
I have used this same methodology to integrate with Open SSO, however, I can not find any information in how to authenticate to Office365 pragmatically using PHP.
Can anyone advise how this is done / where I can look?
Thanks,
-Max
Take a look at this other post that should help you out:
Using PHP and LDAP to connect to Microsoft Office 365
--- Bob ---
I appear to be closer to the answer. Take a look at my question here to view the code - Sending custom HTTP request with PHP
There is also a blog post by MSDN which will provide you with more information here - http://blogs.msdn.com/b/exchangedev/archive/2014/03/25/using-oauth2-to-access-calendar-contact-and-mail-api-in-exchange-online-in-office-365.aspx
Related
What I want to do is I want the users login to the account on their apps, after when they want to login on the web page, they can just scan the QR Code and automatically login the web page.
Currently, I am using Xampp localhost to make my project. I only finished Login and Register web page using PHP.
The problem is:
1) I want to know how can I get the access token from server?
2) How the server know when I scan the QR Code, that is the same person that want to login to the web page?
3) Do I need to use OAuth2 to check from web page and apps the username or password is it match?
I saw lot of example is about how Wechat just scan the QR Code then can login, but if I am using own application, how can I make it like Wechat?
You can use the following package google2fa-laravel to add 2-factor authentication.
composer require pragmarx/google2fa-laravel
The following package generates random qr codes: bacon-qr-code.
composer require bacon/bacon-qr-code
Oauth2 validates tokens, if you want to check if passwords match you should use bcrypt.
Follow the documentation of each package to understand better what is going on with 2-factor authentication.
If you want QR login like whatsapp, there are 2 ways
Ajax polling
Websockets
On shared hosting sometimes you can't open up the websocket port you want ,
Link to article on how to use websocket for QR login in php
If you want to use the webscoket approach,you'll have to run 2 seperate ports.
one for laravel app,
other for listening websocket connections
Link to article on how to use websocket for Qr login in php
For yahoo I am using SocialSample app of yahoo. I can login to yahoo account but it redirects me to a url which I am providing as a fallback url in session authorization.
[self.session sendUserToAuthorizationWithCallbackUrl:#"www.yahoo.com"];
I have no idea how to redirect from browser to my app. I have searched stackoverflow and there is this link How to use Yahoo! contact api in iOS application? in which php script is advised to use. But I have no experience in php. So I am unable to understand the whole logic behind this.
Also when I tried to create a project on developer.yahoo.com, it asks me to provide a domain name while I select private access to user.
help me on these issue.
I'm trying to create a script that allows users to login once (using same username & password on the domain) so that they can access the portal and gmail, instead of signing in twice (one to the portal & the other to their gmail).
I have been trying to retrieve cookies from the gmail but having no luck. Has anyone attempted this before with success?
Please let me know, thanks
Use Google Accounts Authentication and Authorization.
Ah PHP library is available.
I'm writing an iPhone app which works against my own server.
Basically, it's a forum where users can post. I don't want users to sign-in for an account on my server but I rather prefer them to login using any existing account they have: Facebook, Linkedin, Foursquare, etc.
So from the app itself, I want them to be able to login using their existing account which will then allow them to post on the forum.
My question is that: when a user is posting a message, how can I verify whether or not he is logged in with any service? I need to validate it both on the client and server side. I plan on writing the server side using PHP.
Thanks
See this question for a similar discussion (just limited to Facebook sign on). Here's a high-level overview of what should happen (taken from that discussion I linked to):
User opens the app on the phone. Chooses a service with which to authenticate.
Authenticates via one the available services (Facebook, Twitter, foursquare, etc.) and gets some special access token.
Your app takes the token and sends it to your server.
Your server receives the token and validates it. It checks it against the service's API and (at least for Facebook and Twitter) get the corresponding user ID.
Assuming a valid ID, your server checks if user ID has already been used by some user. If so, it logs them in. If the user ID hasn't been created, your server creates its own user record associated with that user ID and logs the user in. In either case, the user ends up logged in and your server issues a session key to your app.
The session key is used for all further communication between your app and your server until the user logs out.
On the phone, you're going to want some OAuth library to allow users to authenticate with another service. You'll probably want to use the Facebook iOS SDK to allow them to use Facebook and use one of the suggested OAuth libraries here for your other authentication services. I have only used the Facebook SDK, so I can't speak as to the general OAuth libraries.
Once logged in, the phone should not store the access token, only the session key.
Assuming that users can use more than one service to access their account, you will also want some way of connecting two services to the same user (probably by email address).
It's up to you to decide how your app and your server communicate. I'd go for a JSON+REST API for communications with the server.
Another option to get your users to login using multiple services is Socialize (www.getsocialize.com). It's an open source SDK that manages your users and authentication so you don't have to implement all the steps that cbrauchli has outlined above.
I was exploring if better/easy to use/implement options exist in 2020 using third party libraries to allow login with social accounts. And found two options:
AuthorizeMe - https://github.com/rubygarage/authorize-me & https://rubygarage.org/blog/authorizeme-ios-libary
Auth0 - https://auth0.com/learn/social-login/ & https://auth0.com/blog/using-centralized-login-to-add-authentication-to-your-ios-apps/
AuthorizeMe supports:
Facebook
Twitter
Google
Instagram
LinkedIn
plus custom providers
Auth0 supports:
Facebook
Twitter
Google
Microsoft (Windows Live)
Yahoo
Instagram
Amazon
LinkedIn
Github
PayPal
vKontakte
Yandex
Box
Baidu
Ren Ren (Xiaonei)
Weibo
Shopify
Wordpress
Yammer
SoundCloud
and custom providers as well
Disclaimer: I am not affiliated with Auth0 or AuthorizeMe.
I am using Open ID on my website using Dope Openid library but I would like to add facebook as an open id provider to the list since facebook also supports OpenID...Can anyone help me out with an explanation or link me to a tutorial (staga.net is using it flawlessly on their site)
*if someone can also explain to me how Staga is using buttons instead of a text box(even SO uses a text box) to have an open ID support...Thanks
check out rpxnow
I'm not sure if I'm mistaking, but I don't believe facebook as of yet offers itself as an openId provider, but rather a consumer. That is you can log on to facebook using your gmail account, but you can't log on to stackoverflow by using your facebook account.
Last time I checked, I found facebook's implementation of an openId sign on to miss the point. To logon to the service using OpenID, go to Account Settings > Linked Accounts, pick an OpenID provider. However, facebook requires that your provider remembers that setting. If you don't have google set to remember facebook as an OpenID site, you won't be able to log on. Which to me is a bit ridiculous, but oh well...
Facebook is not an OpenID provider. If you want people to authenticate via Facebook, you'll need to implement their Facebook Connect API.
http://developers.facebook.com/connect.php