Get code from redirect URL

0
Hi all,   I’m trying to build an app which involves microsoft graph api. At the moment almost everything works. The user can login and request an auth token, and with that auth token they can make the REST calls. However I have a tiny problem. When retrieving an authorization code I have to use a code that gets delivered in the redirect URI for my page. I solved this by retrieving the URL via a javascript action ‘windows.location.href’. This works when using the app in a browser, however not when I try to use it as a mobile app or when I use the app with an old code in the URL. Is there a way to access the URL code without needing to use the javascript action? Or would I need to do it differently in a mobile app?(Btw I’m using this guide → (https://docs.microsoft.com/en-us/graph/auth-v2-user)   Thanks
asked
3 answers
0

This sounds like you need Mendix Deeplink module. When deeplinks are called, a microflow can be run, and you can have the parameters that were passed in the URL passed as parameters to this microflow. This should give you access to your authorisation code. In this case, make sure you select the “Use string arguement” and “Include GET parameters” option in the deeplink setup.

https://docs.mendix.com/appstore/modules/deep-link

Hope this helps.

answered
0

Maybe this blog can help you. The person had the same problem: https://medium.com/mendix/mendix-native-mobile-with-sso-3b86b962a899

Regards,

Ronald

 

answered
0

The marketplace OIDC module covers this use case for both web and mobile apps. Users can log in using their Azure AD credentials and then you can use their access token to make authorized calls to the graph API. I expect it may be exactly what you need.

Even if it’s not exactly your use case, it solves each of the challenges you presented in your question. So, at the very least you can use it to understand how to solve for your use case.

answered