Building Apps with Jigx
...
Microsoft Graph OAuth
Configuring OAuth for MS Graph
Using the OAuth configuration in a Jigx solution
3min
1. Add a function to your solution to get a user’s profile information from Microsoft Graph. See the code below.
2. Add a jig that uses this function.
To invoke the OAuth dialog, you must pass the accessToken parameter from the to the function. This is specific to when the REST provider is used with access tokens. If the access token parameter is not passed as part of the function configuration, the mobile app will not prompt the user for their credentials.
See the code below.
4. Publish the solution and open it in the Mobile app. The user should is prompted for their credentials. After a successful OAuth loop, the token will be stored for future use, and the function will be executed, displaying the information on the .
OAuth loop
- After a successful OAuth loop, the returned token will be stored for future use until it expires. If the provider supports a refresh token, will automatically use the refresh token to avoid prompting the user again for credentials. Once the refresh token becomes invalid or if no token was provided, will prompt the user with the OAuth loop to get a new token.
- If authentication fails, the user can use the Secondary Identities menu in the Settings section of the Jigx mobile App to manage OAuth tokens. If the token is not visible in the list, something failed early during the OAuth loop. Use the debug tools in to trace the error using the output window.
Updated 29 Apr 2024
Did this page help you?