Differences

This shows you the differences between two versions of the page.

Link to this comparison view

field type - facebook oauth [2016/05/03 11:36]
field type - facebook oauth [2016/09/14 14:19] (current)
Line 1: Line 1:
 +====== Facebook OAuth ======
 +The Facebook OAuth field allows a software developer to implment a Log in with Facebook button or to create a button that asks for additional permission such as the publish permission. ​ It is regarded as bad practice to ask for publish permission as part of the Log in with Facebook flow. To utilize this field the application developer or their client will need to [[Setup Facebook Account|setup a Facebook Application]]. ​ This field is required to use the [[Enterprise Service Bus - Facebook|Facebook Enterprise Service Bus]].
  
 +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 - Facebook"​ 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 Facebook.
 +  - You can continue adding fields or click the "​Select"​ button to finish adding.
 +
 +
 +===== Features =====
 +==== Field Label ====
 +  * [[Field Setting - Field Label|Field Label]]
 +  * [[Field Setting - Display Alternate Label]] (affects this form only)
 +==== Grid Appearance ====
 +  * [[Field Setting - Column Span|Column Span]]
 +  * [[Field Setting - Row Span|Row Span]]
 +  ​
 +==== Tooltip ====
 +  * [[Field Setting - Tooltip|Tooltip]]
 +  * [[Field Setting - Descriptive Text|Descriptive Text]]
 +  * [[Field Setting - Display Alternate Descriptive Text|Display Alternate Descriptive Text]] (affects this form only)
 +
 +==== OAuth Consumer Keys ====
 +  * [[Field Setting - Facebook Application Id|Facebook Application Id]]
 +  * [[Field Setting - Facebook Application Secret|Facebook Application Secret]]
 +
 +==== OAuth Permissions ====
 +  * [[Field Setting - Requested Permissions|OAuth Permissions (scope)]]
 +
 +==== Facebook Link Appearance ====
 +  * [[Field Setting - Facebook Link Appearance|Signin Appearance]]
 +==== Block Association ====
 +  * [[Field Setting - Temporary Block Association|Temporary Block Association]]
 +  * [[Field Setting - Global Block Association|Global Block Association]]
 +
 +===== Implementing a Log in with Facebook Flow =====
 +
 +  - Configure the field with a Facebook Application Id and Facebook Application Secret
 +  - Configure the OAuth Successful Actions. ​ If the user is able to login to Facebook 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 Facebook about the Facebook User.  Here the application developer should search the existing users and see if one already has the same Facebook 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 Facebook 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.
 +  - Configure the OAuth Failed Actions. ​ If the user clicks the cancel button on the Facebook page or does not accept the permissions the OAuth Failed actions will run. The error message and error code generated by Facebook will be presented as run time variables. ​ These values can be used to construct a nice error message to present to the user but should not be show directly to the user because they are cryptic.
 +
 +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 Facebook 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.
Copyright WorkXpress, 2018