When creating a lot of different web front-ends, it is always rather complex to get started with single sign-on or integrated login.

The simple way to not maintain a credential database or passwords is to validate against a 3. party website.
This is where the Office 365 Portal comes in handy, especially because many companies are already validating against or with it.

I created this code as part of another solution, the example here has been cut down for demonstration purposes and easy integration.
You will be able to validate against Portal.microsoftonline.com as long as the login is allowed for any given user.

It’s easy to add, so after first login we can assign each user to roles/groups or whatever we need.
Specific domains or usernames can of course be enforced.

Login page:

simple login page

If login failed:

And our simple success login page

NOTE: Keep in mind, You must move the tmp location or create a folder called tmp with RW permissions.

Download the source files:

Download “Office365SecurityToken.zip” Office365SecurityToken.zip – Downloaded 227 times – 5 KB