- Print
- DarkLight
Switching Teams without Logging Out
Past Behavior (Presence SDK)
The old Presence SDK only allowed a single Team login, along with a Host login.
This works fine any App that supports a single Team.
- Bucks App only logs into a single Team, the Milwaukee Bucks
- Bucks App only contains a single API Key, the key for the Milwaukee Bucks
This works fine, but what about an App that supports multiple teams?
- A League App may want to support all teams in that league
- A Venue App may want to support all teams that play at the Venue
In this case, the User must be logged out when switching Teams (changing API Keys):
- Configure Team1 API Key
- User logs into Team1
- User's Team1 tickets are fetched, user views Team1 tickets
- User switches to Team2
- User is logged out of Team1
- Configure Team2 API Key
- User logs into Team2,
- User's Team2 tickets are fetched, user views Team2 tickets
- User switches back to Team1
- User is logged out of Team2
- Go back to step 1
In the old Presence SDK, it is not possible to switch teams (change API Keys) without logging the user out first (steps 5 and 10).
Current Behavior (Tickets SDK)
The new Authentication SDK allows user to be logged into multiple Teams at once, without logging out.
- Configure Team1 API Key
- User logs into Team1
- User's Team1 tickets are fetched, user views Team1 tickets
- User switches to Team2
- Configure Team2 API Key
- User logs into Team2
- User's Team2 ticktets are fetched, user views Team2 tickets
- User switches back to Team1
- User is still logged into Team1
- User's Team1 tickets are fetched, user views Team1 tickets
The Tickets SDK currently only displays tickets for one Team at a time, but at least the user doesn't have to re-login when switching back to Team 1 (step 9).
There are some special considerations when using this mode:
- Developer must enable ephemeral web browser session
TMAuthentication.shared.forceEphemeralWebBrowserSession = true
TMAuthentication.Builder().forceNewSession(true)
- This prevents an issue where Team1's oauth token is returned to Team2 during login
- Unfortunately, this ALSO disables the shared login feature, where the user doesn't have to re-enter the username and password for Host (see Non-Ephemeral vs. Ephemeral Login below)
- This issue is not easily resolved
- Tickets SDK can currently only store one Team's tickets at a time
- While the user won't need to re-login, the user's Tickets will need to be refetched when switching teams (step 10 above) .
- This refetch is automatic and will require no extra coding effort on your part, but it is not an ideal user experience.
- This issue will be resolved in an upcoming release of Tickets SDK
Notice in the video how the user only has to log into each Team once.
Then the user can switch teams without having to re-login!
Example of being logged into 3 different Archtics Teams at once:
However, also notice that the tickets are refreshed/reloaded each time the Team is changed.
Future Improvements (Tickets SDK)
An upcoming version of Tickets SDK will store each team's Tickets independantly, resolving the above issue where the tickets must be refetched each time the user switches teams.
It may be possible to resolve the ephemeral web browser session issue, but we don't have a solution determined at this time.
Non-Ephemeral vs. Ephemeral Login
Non-Ephemeral
iOS:
TMAuthentication.shared.forceEphemeralWebBrowserSession = false
Android:
TMAuthentication.Builder()
.apiKey("")
...
.forceNewSession(false)
.build()
By default, iOS uses a non-ephemeral Login web browser session. This means cookies are stored between sessions.
This is useful since we can re-use the user's Team Archtics login to also log into Ticketmaster Host.
Notice in the video how the user only has to enter their username and password once:
Ephemeral
iOS:
TMAuthentication.shared.forceEphemeralWebBrowserSession = true
Android:
TMAuthentication.Builder()
.apiKey("")
...
.forceNewSession(true)
.build()
This means cookies are NOT stored in iOS between sessions.
This is useful since we avoid a bug where Team1's credentials are accidently returned to Team2.
But it also means the user has to log into Team Archtics and Host separately.
Notice in the video how the user has to enter their username and password twice:
The good news is that by using ephemeral web browser sessions, we can log the user into as many Team Archtics clients as we want!
Example of being logged into 3 different Archtics Teams at once:
Logout and multiple Teams
Currently, logout only logs the user out of the current Team.
However, it also logs the user out of Host. This is necessary since in order to "log out" we must clear all the user's currently viewed tickets for both Archtics and Host.
This means, that if the user tries to switch to a different Team, then the user will be asked to log back into Host.
Notice in the video that the user is logged out of both Broncos Team and Ticketmaster Host.
Then the user switches to Chiefs, and is asked to log back into Ticketmaster Host.
This may be the behavior you want.
Or maybe you'd prefer to simply show the user their Chiefs tickets with the option to log back into Host.
This is accomplished by turning off combined login:
TMAuthentication.shared.useCombinedLogin = false
Notice in the video that the user is logged out of both Broncos Team and Ticketmaster Host.
Then the user switches to Chiefs, and is shown their Chiefs Archtics tickets.
Finally, the user optionally logs back into Ticketmaster Host to see their Host tickets.
Keep in mind that most users NEVER log out of an Application.
They may delete the Application from their device, but the log out button is almost NEVER used by the average user.