The Twitter OAuth field allows a software developer to implment a Sign in with Twitter button. To utilize this field the application developer or their client will need to create a [[https://​apps.twitter.com/​|Twitter Application]].

+

This field does not store data it only provides actions that will run when the field processes an OAuth request.

+

+

===== How to Create =====

+

- Click the {{:​presentation-layer:​field-plus.png|}} to add a field in your [[Form|form]].

+

- Choose "New Field"

+

- Select the table you wish to add the field to. Most of the time this will be the current [[Table|table]] you are on, called the current [[Context|context]].

+

- Enter a field name and click "​Choose Type".

+

- Choose "OAuth - Twitter"​ from the list of field types.

+

- You will be prompted to provide [[Expression Builder|expressions]] that will define the critical values required to communicate with Twitter.

+

- You can continue adding fields or click the "​Select"​ button to finish adding.

- Configure the OAuth Successful Actions. ​ If the user is able to login to Twitter and accepts the permissions requested by the application the OAuth Successful Actions will run. Durring the execution of these actions several values are provided by Twitter about the Twitter User. Here the application developer should search the existing users and see if one already has the same Twitter User Id and if they do change to that user and redirect the user to the appropriate next page via an [[Action Type - Open Page|Open Page]] action. ​ Otherwise a new WorkXpress user should be created and the Twitter data should be stored against that user. Of note it is important when creating a user to generate and save a value into the Username field. ​ Without that field value the change user action will fail.

+

+

Notes

+

* If no [[Action Type - Open Page|Open Page]] actions are defined for the hook that ran then the User will be redirected back to the page the Twitter OAuth Field originated from.

+

* When defining an Open Page action as part of the login flow do NOT use the dialog or popup UI treatment.