Sure, please note I am not a developer, I used my logic to edit
file: lib/external_credential/microsoft365.rb
original:
…
def self.generate_authorize_url(credentials, scope = ‘Sign in to Outlook Sign in to Outlook offline_access openid profile email’)
params = {
‘client_id’ => credentials[:client_id],
‘redirect_uri’ => ExternalCredential.callback_url(‘microsoft365’),
‘scope’ => scope,
‘response_type’ => ‘code’,
‘access_type’ => ‘offline’,
‘prompt’ => ‘consent’,
}
…
new:
…
def self.generate_authorize_url(credentials, scope = ‘Sign in to Outlook Sign in to Outlook offline_access openid profile email’)
params = {
‘client_id’ => credentials[:client_id],
‘redirect_uri’ => ExternalCredential.callback_url(‘microsoft365’),
‘scope’ => scope,
‘response_type’ => ‘code’,
‘access_type’ => ‘offline’,
}
…
file: spec/lib/external_credential/microsoft365_spec.rb
original:
…
RSpec.describe ExternalCredential::Microsoft365 do
let(:token_url) { ‘Sign in to your account’ }
let(:token_url_with_tenant) { ‘Sign in to your account’ }
let(:authorize_url) { “Sign in to your account” }
let(:authorize_url_with_tenant) { “Sign in to your account” }
…
…
describe ‘.link_account’ do
let!(:authorization_payload) do
{
code: authorization_code,
scope: scope_payload,
authuser: ‘4’,
hd: ‘example.com’,
prompt: ‘consent’,
controller: ‘external_credentials’,
action: ‘callback’,
provider: provider
}
…
…
describe ‘.refresh_token’ do
let!(:authorization_payload) do
{
code: authorization_code,
scope: scope_payload,
authuser: ‘4’,
hd: ‘example.com’,
prompt: ‘consent’,
controller: ‘external_credentials’,
action: ‘callback’,
provider: provider
}
…
new:
…
RSpec.describe ExternalCredential::Microsoft365 do
let(:token_url) { ‘Sign in to your account’ }
let(:token_url_with_tenant) { ‘Sign in to your account’ }
let(:authorize_url) { “Sign in to your account” }
let(:authorize_url_with_tenant) { “Sign in to your account” }
…
…
describe ‘.link_account’ do
let!(:authorization_payload) do
{
code: authorization_code,
scope: scope_payload,
authuser: ‘4’,
hd: ‘example.com’,
controller: ‘external_credentials’,
action: ‘callback’,
provider: provider
}
…
…
describe ‘.refresh_token’ do
let!(:authorization_payload) do
{
code: authorization_code,
scope: scope_payload,
authuser: ‘4’,
hd: ‘example.com’,
controller: ‘external_credentials’,
action: ‘callback’,
provider: provider
}
…
hope it helps