Skip to main content

Auto-Login using URL Integration

DFenn-1143
Original Poster

Is it possible to create a user with BasicAuthentication (so that they can access the Geotab portal) AND for our app to control their password. The user should never be able to set the password or know the password, but be able to view the Geotab Portal.

Q1. Does this involve 2 API calls for the initial setup and then the launch to test the connection?
Step 1: Create the User

Step 2: Update the User with their password and now set it to not change

Step 3: Launch the portal after authenticating the user, i.e. getting the token or SessionId

NOTE: This should not cause the user to login again. They should be automatically logged in.

Thanks

Join the conversation

You need to be logged in to reply to this post and participate in the Geotab Community discussions.

6 Replies

EishiFUN
Community Administrator

Hello @DFenn-1143 ,

Hello,
Thank you for asking your question in our community. I checked the current SDK documentation and the service-account guidance. I also wanted to tag in @TuckerBA-1087 in case there is anything I didnt find or any experience he can share if he has tried something like this before.

The User object does support setting a password and controlling the changePassword flag. However, the documented Authenticate API returns a Credentials object for making API calls. The returned sessionId is not documented as a browser-login token or as a supported way to launch the MyGeotab portal without another login.

Therefore, while creating the user and setting its password may be possible through API calls, I would not recommend building the final automatic portal handoff around that sequence:
1. Create a Basic Authentication user.
2. Set a password that the user does not know.
3. Authenticate with the API.
4. Reuse the API session to silently launch the portal.

That portal-launch step is not a documented or supported integration pattern.
If the account is intended only for background API access, a service account is the recommended approach. Service accounts are explicitly API-only, and the documentation states that attempting to use service-account credentials to log in through the MyGeotab UI will result in an error:
https://support.geotab.com/software-integration/doc/service-acct-api

If the person needs to view the MyGeotab portal, they should use a supported user authentication method such as their own Basic Authentication credentials, SSO, or Unified Login. The API session ID should be used for API calls only.

Hope that helps!
Eishi FUN

DFenn-1143
Original Poster

@EishiFUN
Are you saying that there is no support for URL integration using BasicAuthentication?

@DFenn-1143 Nothing like that is supported that I know of, but you could maybe do it a hacky way by looking at what Geotab is storing in the browser Cookies / local storage and then recreating that from API authentication, but that's not supported and could break at any time if Geotab changes anything. Is there a reason you want this specific workflow where users log in without ever knowing their passwords?

DFenn-1143
Original Poster

@TuckerBA-1087 You had this auto login feature before. It was in the help pages of your site from ~2016.

This helps us manage their credentials and access, without them ever having to know that there is a portal.
We launch the URL in an embedded browser window in a WinForms application.

Thanks

@DFenn-1143 I'm not actually part of Geotab, we're Geotab partners, and unfortunately I wasn't here in 2016 so I'm not aware of anything back then, but Geotab does support SAML which you might be able to use for that assuming the users do have users in your system that would be compatible with it. Otherwise the only thing I can think of would be the hacky way I mentioned before unless someone else knows something different. Sorry I couldn't be more help!

@EishiFUN It is kind of documented here - https://developers.geotab.com/myGeotab/guides/myGeotabUrls/#credentials - but it doesn't give any direct example of passing the session ID into the URL but it is possible to do for like a Kiosk login senario.

@DFenn-1143It doesn't given an example of how a session ID should be added, and with since the introduction of CIAM and Unified Login password management has been removed from the MyGeotab database level all to gether. Unless the user account doesn't have an email address (they still need to have a unique username in CIAM though, and conflicts for usernames like "JohnSmith" are lot more possible). As @TuckerBA-1087mentioned it might be easier to integrate SAML SSO into your application use that method to access the Geotab portal.

Depending on how you're displaying the portal in the application it my prevent access if doing it through an iFrame in a browser-like application - https://developers.geotab.com/myGeotab/guides/myGeotabUrls/#embedding-myg-in-iframe

Still have questions?