microsoftgraph / msgraph-sample-rubyrailsapp

This sample demonstrates how to use the Microsoft Graph REST API to access data in Office 365 from Ruby on Rails apps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Configuring the Microsoft identity platform endpoint for forgot password

VedaRamaiah opened this issue · comments

@jasonjoh

We can define the endpoint for authorize_url & token_url by creating an OAuth2 Strategy as mentioned below.

Configure the Microsoft identity platform endpoints

  option :client_options,
         :site => 'https://login.microsoftonline.com',
         :authorize_url => '/common/oauth2/v2.0/authorize',
         :token_url => '/common/oauth2/v2.0/token'

I have to configure the same for forgot password and couldn't find anything mentioned related to the forgot password in the sample.

Could you please let me know what will be endpoint for the forgot password scenario?

I figured out that we have to pass different policy name in the authorize_url in order to call sign-in or password reset end point.

authorize_url: '/< tenant-name >/< policy-name >/oauth2/v2.0/authorize'

For example:
Sign-in : policy-name - Abc-Sign-In
Password-reset: policy-name - ABC-PSWD-RESET.

User will be redirected to login page via '/auth/microsoft_graph_auth'
i.e
<%= link_to "Click here to sign in", "/auth/microsoft_graph_auth", method: :post, class: "btn btn-primary btn-large" %>

I am wondering how to pass this different policy names while making a call to '/auth/microsoft_graph_auth/' ?

@VedaRamaiah this isn't in scope for this tutorial, and we're very limited in our ability to provide how-to assistance in this forum. You might have better luck on Stack Overflow. I'm not sure that this password reset functionality you're describing is part of OAuth.

Sure, thanks!