[Office 365 Connector] Implementing User log in

[Office 365 Connector] Implementing User log in

  
Forge Component
(21)
Published on 2015-11-27 by João Martins
21 votes
Published on 2015-11-27 by João Martins


I'm trying to make an app that has Azure AD authentication, and I have succeeded, kinda.


First, I registered my application on Azure:


Then I configured the Office365Connector like so:



But how do I progress from here?


I've learned that the Office365Connector's default resource that it wants from Azure is Outlook


But what is the resource-string for Azure Active Directory and, after log in, how can I get the user's details?

Hello Lars,

This connector is specific for fetching emails from an office 365 email account using the Outlook office API, is that what you are trying to accomplish? 

To get user's details you can use the already existent function GetuserInfo under the Utils folder, is that what you need?

Hello Lars,

 If you want to just authenticate user via Azure AD, you can also go for MicrosoftLoginConnector.


Below I am listing all the steps to implement SSO:

To implement SSO Office 365 first you need to create App in https://portal.azure.com. 

Steps to create App in https://portal.azure.com: 

  1. Login to Azure account 

  2. Find and open Azure Active Directory on Dashboard. 

  3. In Azure Active Directory click on App Registration menu. 

  4. Click on +New application registration menu. 

  5. Enter Name, Application Type, Sign-on URL (Login URL of your website) and click on Create. 

  6. Here you can find Application ID(Client ID). 

  7. Enter Home page URL of your website in : Settings?Properties?Home Page URL 

  8. Create Secret Key in: Settings?Keys?Password Section ? Enter Description & Duration and click on save button to generate Secret Key. 

  9. Enter Reply URLs in: Settings?Reply URLs. 



 
 Steps to implement SSO in OutSystem: 

  1. Install MicrosoftLoginConnector from forge.  


https://www.outsystems.com/forge/component/3275/microsoft-login-connector/?Unfollow=False 


  1. Open MicrosoftLoginConnector in service studio. 

  2. In Modules section you will find 2 modules 

    1. MicrosoftLoginConnector 

    2. Microsoft_StringUtils(extension) 

  3. Open MicrosoftLoginConnector Module 

  4. Create a link on Login page set its destination as CommonFlow\OAuthLogin . 

  5. CommonFlow\OAuthLogin require 5 input parameters , so you need to set parameters value. 

    1. OriginalURL: URL Page where the user is going to be redirect after being Logged in. 

    2. Resource: 
         - Only for Login with Microsoft use "https://graph.windows.net" value. 

    3. Scope: Impersonation permissions granted to the client application. The default permission is user_impersonation. The owner of the secured resource can register additional values in Azure AD. 

    4. Client Id - Get from Azure Settings. The Application Id that the registration portal assigned your app. 

    5. ClientSecret - Get from Azure Settings. The application secret that you created in the app registration portal for your app.  

  6. In CallbackPage Screen's Prepration you will get all the response data. 


Let me know if you need any more help.


Regards,

Afaque Shaikh