- Generate the URL to the desired piece of MITS content. These examples are visible on our demo system when logged on as user WILL (password “will”)
- Grid Report
- launchFlashScreenAsynchronously.flow takes libraryName and id
- For example: http://mda.mits.com/mitsdiscover/launchGrid.flow?libraryId=AR.COMPANY.INV&gridId=R.AR.INV
- Chart report
- launchChart.flow takes libraryName and id
- For example: http://mda.mits.com/mitsdiscover/launchChart.flow?libraryId=WILL&chartId=2041
- Prompted dashboard:
- displayFullScreenDashboard.flow takes libraryName and id and also one parameter for each prompt name, with spaces in the name escaped as %20. The values of these parameters should be the identifier IDs.
- For example
- This is equivalent to launching the Bill To Customer Status Scorecard with these values:
- For more example dashboard URLs, inspect the links used any place that MITS Discover offers to let you drill across to a dashboard, like here:
- The links produced in the product include a “valuesAreDescriptions” parameter which is unused.
- Dashboards can take a little while to launch, so they can also be launched asynchronously, which displays a loading message while it waits.
- Instead of just going to the dashboardUri, go to launchDashboardAsynchronously.flow?dashboardUri=[encoded dashboardUri]
- For example http://mda.mits.com/mitsdiscover/launchDashboardAsynchronously.flow?dashboardUri=displayFullScreenDashboard.flow%3FlibraryName%3DCUSTOMER.SCORECARDS%26id%3DFS.CUSTOMER.BILL.TO.STATUS.SCORECARD%26Sales%2520Rep%3D1013%26Bill%2520To%2520Customer%3D103273
iii. Note that the dashboardUri value has been through a round of percent-encoding
- Get the authentication token
- Make a request to http://[mitsURL]/getToken.md and pass it parameters username and password.
- The user name and password can be in the URL, or in GET or POST parameters.
- For example, http://mda.mits.com/mitsdiscover/getToken.md?username=WILL&password=will
- This produces an xml response with a token, which will be two integers separated by an underscore, for example
- <token>14c04fb1088_2</token>
- Note that it doesn't actually do the authentication at this point
- Use the token
- Make another request to http://[mitsURL]/useToken.md?token=[token]
- The user/pass in the token are authenticated and now the user is logged in and their session will remain valid until they log out or it times out
- Now you can make another request to a valid url eg http://mda.mits.com/mitsdiscover/listReports.flow
- Optionally, you can combine those steps by using the redirectUrl parameter. The passed URL should be encoded, which might mean another layer of encoding. For example, having gotten the token for user WILL as above, (you’ll need to replace the token with a new one to see it work)
- http://mda.mits.com/mitsdiscover/useToken.md?token=1554aeae370_2&redirectUrl=displayFullScreenDashboard.flow%3FlibraryName%3DCUSTOMER.SCORECARDS%26id%3DFS.CUSTOMER.BILL.TO.STATUS.SCORECARD%26Sales%2520Rep%3D1013%26Bill%2520To%2520Customer%3D103273
- After using useToken.md once, the token is invalidated because it is no longer needed. The user is now logged in and can move about, or subsequent links directly to content can be made without the useToken option.
- Troubleshooting
- If the token has timed out or been removed because it was used, you’ll see an error about “No Token Provided”
- If the user is already logged in and you hit getToken.md a second time you get PRE_AUTHENTICATED for a token. Hit logoutRedirect.flow to clear the current user out of the session, eg http://mda.mits.com/mitsdiscover/logoutRedirect.flow
- Configuration
- The token’s timeout period (maximum time between when it is requested and when it is used) can be set in MITSDiscover.servlet.authCookieTimeout in the mitsdiscover.properties file
- Regular session timeout can be configured with MITSDiscover.session.timeoutMinutes
Comments
0 comments
Article is closed for comments.