This is a extension to a previous post about creating a Rails web site that uses external OAuth providers to authenticate users. Until now the Rails template supported Facebook, Twitter, LinkedIn and Google OAuth providers. Lately I have added Office 365 support to the template available on Github. This could be useful for e.g. companies that want to develop web sites for internal applications and allow their internal users to log on using their standard accounts.
- Go to portal.azure.com & log in
- Expand “more services” and select “active directory”
- Choose “applications” and click “add” at the bottom (or click on ”
Add an application you’re developing” if you are viewing the domain overview)
- Give your web application a name
- Enter a Sign-On URL and an App ID URL (e.g. http://example.com/users/sign_in). It is not obvious what the App ID URI should be but it seems to work fine to use the same as the Sign-On URL
- Configure the app and modify the reply URL to be e.g. http://example.com/users/auth/office365/callback/
- Copy the Client ID and add it to the Rails template
- Select duration under “keys”, press save and then copy the generated key to the Rails template
Finally, deploy your web site and hopefully it should work.