Azure OAuth 2.0 authorization endpoint (v1) is redirecting to wrong URL
Hi, I’m Yahya Shareef. I’m trying to integrate OneDrive into my web app to allow users to save files in their OneDrive accounts. To get access, I was using the "customers" endpoint.
https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize?client_id=${process.env.ONE_DRIVE_CLIENT_ID}&scope=files.readwrite.all%20files.readwrite%20offline_access%20User.Read%20User.Read.All&response_type=code&response_mode=query&redirect_uri=${process.env.ONE_DRIVE_REDIRECT_URI}
We want to accept all types of users, so we changed the settings to allow access for all user types.
We also updated the endpoint to "common"
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=${process.env.ONE_DRIVE_CLIENT_ID}&scope=files.readwrite.all%20files.readwrite%20offline_access%20User.Read%20User.Read.All&response_type=code&response_mode=query&redirect_uri=${process.env.ONE_DRIVE_REDIRECT_URI}
We are encountering an issue with a common endpoint. The redirect URI is taking us to the wrong path. We set the redirect URI to "http://localhost:5173/storage/one_drive"
, but it is redirecting to "http://localhost:5173/apis?code=T66xrIUED7-7bbodmmc8LyrcEPMuaDm2CnMaDdC_Dhh6u&state=X2ZFVjFsRGMtQ2RIZXZtM3ZoVHNBQ3ZSc3VSanZneVJfNFZhWVg4WjNjcg%3D%3D"
.
This problem has never occurred with the previous endpoint, "customers." What can I do to resolve this?