Skip to content
This repository has been archived by the owner on Feb 23, 2019. It is now read-only.

Introduce ability to pass platform parameter to the login request #171

Open
piterfm opened this issue Jun 1, 2017 · 5 comments
Open

Introduce ability to pass platform parameter to the login request #171

piterfm opened this issue Jun 1, 2017 · 5 comments

Comments

@piterfm
Copy link

piterfm commented Jun 1, 2017

The mobile team needs to write a thorn test to verify the /metadata endpoint. For that, the test setup needs to login as a mobile user. Add ability to specify the platform parameter for the test set-up proc.

@jcsmorais jcsmorais added the major label Jun 1, 2017
@rhoggSugarcrm rhoggSugarcrm self-assigned this Jun 2, 2017
@rhoggSugarcrm
Copy link
Contributor

@piterfm just want to make sure we have all the requirements here. My understanding is:

  • Mobile logs in by adding platform=mobile to all OAuth2 login requests
  • Mobile adds platform=mobile to all refresh requests

Let me know if there's a misunderstanding or there are any other requirements that I'm missing.

Thanks!

@piterfm
Copy link
Author

piterfm commented Jun 2, 2017

@rhoggSugarcrm that's correct.

@jcsmorais
Copy link
Contributor

jcsmorais commented Jun 3, 2017

Currently we support Agent.as(username) which does two different things:

  1. creates and logs username in, if he's not instantiated yet
  2. If there's already a UserAgent instance associated with given username, that same instance is returned

Both login and refresh flows currently work under the assumption that platform is undefined, meaning it defaults to whatever the server decides, in this case base.

We can introduce support for this to be configurable at the Agent layer, where by default it remains undefined, but if one states that Agent.platform = 'base'; all subsequent Agent.as calls that fall into 1. (above) are going to use that same platform for both login and refresh flows.

Thoughts @rhoggSugarcrm , @khigakisugar, @yvan33 ?

@rhoggSugarcrm
Copy link
Contributor

At first glance, that sounds significantly better then the approach of complicating the Agent.as interface.

Here's something Joao whiteboarded for me earlier today:

let joao = Agent.as('Joao'); // defaults to base
Agent.platform = 'mobile';
let bob = Agent.as('Bob'); // Bob is logged in as mobile. Joao remains logged in as base.

@rhoggSugarcrm
Copy link
Contributor

Side note: This will probably also allow us to test Portal using Thorn.

@rhoggSugarcrm rhoggSugarcrm removed their assignment Jan 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants