I'm working on a SSO authentification using azure ad passport.
Here is my backend code :
azure strategy:
@Injectable()
export class AzureADStrategy extends PassportStrategy(OIDCStrategy , 'azure-ad') {
constructor() {
super({
clientID:clientID,
clientSecret: clientSecret,
identityMetadata: `https://login.microsoftonline.com/${tenantID}/v2.0/.well-known/openid-configuration`,
redirectUrl: redirectURL,
responseType: 'code',
responseMode: 'query',
allowHttpForRedirectUrl : true,
scope: ['profile', 'User.Read'],
});
}
authenfitication controller :
@Get('/login')
@UseGuards(AzureAdAuthGuard)
login() {
// This route will initiate the Azure AD login process
// The actual login flow will be handled by the guard
}
Frontend :
<template>
<div>
<h1>Login</h1>
<button @click="login">azure</button>
</div>
</template>
<script setup>
import axios from 'axios'
const login = async () => {
window.location.href = 'http://localhost:3000/auth/login'
What happens is that the @Azureguard on the login initiates the sso authentification, and does redirect toward the redirect uri specified in the strategy configuration, but what should i do after this to get the user info ??????
Thank you