Search code examples
authorizationhttp-redirectaccess-tokenonedrive

OneDrive authorization redirectURI (setup on Application Registration Portal)


I have a single web application that is using different locales (around 35) to render localized content. I am using token flow authentication (more details https://dev.onedrive.com/auth/graph_oauth.htm) to generate a new access token.

This is implemented through a new window that is doing a GET request to login.live.com/oauth20_authorize.srf?client_id=....&scope=scope=onedrive.readwrite&response_type=token&redirect_uri=REDIRECT_URI (when there is an access_token expiration I am using a silent way via iframes to get a new access_token the same way as with window). Similar way of authentication was done on OneDrive Explorer sample web app (https://github.com/OneDrive/onedrive-explorer-js)

After successful authentication, there is a redirect to the REDIRECT_URI (this is built dynamically on my app based on the locale.

The problem I have is that I cannot manually add all the possible redirect uris on the Microsoft registration portal (there is a limit of 21).

Do you know if there is any way to do that by using wildcards on the setup of redirect_uris in the portal? Or maybe another way to implement that logic? I did some investigation online and found many developers having the same problem. Is there any recent patch/update available regarding that?

Thanks.


Solution

  • What I did as a solution was to add a new servlet / temp page that is being used as a callback page (using the redirect URI that is defined on Microsoft Application portal). The page is responsible for doing the logic and then redirect to the main application page.