You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/integrations/salesforce/index.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,8 @@ description: Integrate Friendly Captcha into your Salesforce environment
12
12
Integrating Friendly Captcha involves a front-end component and a back-end component. We recommend familiarizing yourself with the [Friendly Captcha documentation][fcdocs] to develop a baseline understanding of how an integration works.
13
13
14
14
For the front-end component of the integration, this package provides a Lightning Web
15
-
Component (LWC). If you're using Visualforce, you should also be able to simply insert
16
-
[the standard markup][html] for the front-end integration.
15
+
Component (LWC). If you're using Visualforce, you should be able to insert
16
+
[the standard markup][html] for the front-end integration, instead of using the LWC.
17
17
18
18
For the back-end component of the integration, this package provides an Apex class that
19
19
performs an HTTP request to the Friendly Captcha site verification API.
@@ -53,10 +53,10 @@ Click the **Manage Records** link, and then edit the **Settings** record. You'll
53
53
54
54
| Setting | Location | Description |
55
55
| -- | -- | -- |
56
-
| Sitekey | Shared | A Friendly Captcha sitekey associated with an application. Copied from the application configuration in the Friendly Captcha dashboard. |
56
+
| Sitekey | Shared | A Friendly Captcha sitekey associated with an application. You can find this value in the application configuration in the Friendly Captcha dashboard. |
57
57
| APIEndpoint | Shared | The endpoint URL used for communicating with the Friendly Captcha API. Shorthands 'eu' or 'global' are accepted. Default is 'global'. Using the 'eu' endpoint requires access that must be enabled in the Friendly Captcha dashboard. |
58
-
| APIKey | Apex | An API key used for communicating with the Friendly Captcha API. Created in the Friendly Captcha dashboard. |
59
-
| Strict | Apex | Determines the failure mode behavior of the captcha response verification (siteverify) result. This mode only applies when the API was not able to verify the response, which might occur for network connectivity reasons or a misconfiguration of the client. When 'strict' is enabled, unverified responses will be set to 'reject', in a fail-closed behavior. When disabled (the default), unverified responses will be set to 'accept', in a fail-open behavior. |
58
+
| APIKey | Apex | An API key used for communicating with the Friendly Captcha API. You can create an API key in the Friendly Captcha dashboard. |
59
+
| Strict | Apex | Determines the failure mode behavior of the captcha response verification (siteverify) result. This mode only applies when the API was not able to verify the response, which might occur for network connectivity reasons or a misconfiguration of the client. When 'strict' is enabled, unverified responses will be set to 'reject' (i.e. fail-closed behavior). When disabled (the default), unverified responses will be set to 'accept' (i.e. fail-open behavior). |
60
60
| Timeout | Apex | How long (in milliseconds) to wait for a captcha response verification request to complete. |
61
61
| StartMode | LWC | The start mode determines the behavior around automatic activation of the widget. Activation here means the challenge gets requested and gets solved. |
62
62
| Theme | LWC | The theme for the widget. |
@@ -196,7 +196,7 @@ Here's the final Flow:
196
196
197
197
### Lightning Web Component
198
198
199
-
Using the LWC from code (e.g., from within another LWC) looks like this:
199
+
Using the LWC from code (e.g. from within another LWC) looks like this:
VerifyResult is a wrapper around the response of an
4
-
/api/v2/captcha/siteverify request.
4
+
`/api/v2/captcha/siteverify` request.
5
5
6
6
The main methods are `shouldAccept` and `wasAbleToVerify` .
7
7
The first one you should use to determine if the user's request should be accepted;
8
8
the second one to determine if the request was able to be verified.
9
-
If that returns false, you should alert yourself.
9
+
If that returns false, it means that there was an issue in the communication with the
10
+
Friendly Captcha API, and you should log an error or notify your monitoring system.
10
11
11
12
## Methods
12
13
### `isStrict()`
13
14
15
+
Whether the `strict` option was set to true on the client.
16
+
In `strict` mode this will only return `true` if the request was successful
17
+
(e.g. verification could happen), and the challenge was solved successfully.
18
+
19
+
By default, `strict` is set to `false` , which means that the request
20
+
will be accepted if the challenge could not be verified (also called *fail open*).
21
+
14
22
#### Signature
15
23
```apex
16
24
global Boolean isStrict()
@@ -19,13 +27,13 @@ global Boolean isStrict()
19
27
#### Return Type
20
28
**Boolean**
21
29
22
-
whether the ,[object Object], option was set to true on the client. In,[object Object], ,[object Object], mode this will only return ,[object Object],[object Object], if the request was successful (e.g. verification could happen), and,[object Object], the challenge was solved successfully.,[object Object],,[object Object], By default, ,[object Object], is set to ,[object Object],, which means that the request,[object Object], will be accepted if the challenge could,[object Object], not be verified (also called *fail open*).
23
-
24
30
---
25
31
26
32
### `shouldAccept()`
27
33
28
-
Determines if the user's request should be accepted.
34
+
Determines if the user's request should be accepted.
35
+
36
+
Returns true if the request should be accepted, false otherwise.
29
37
30
38
#### Signature
31
39
```apex
@@ -35,13 +43,13 @@ global Boolean shouldAccept()
35
43
#### Return Type
36
44
**Boolean**
37
45
38
-
true if the request should be accepted, false otherwise.
39
-
40
46
---
41
47
42
48
### `shouldReject()`
43
49
44
-
Determines if the user's request should be rejected.
50
+
Determines if the user's request should be rejected.
51
+
52
+
Returns rue if the request should be rejected, false otherwise.
45
53
46
54
#### Signature
47
55
```apex
@@ -51,14 +59,14 @@ global Boolean shouldReject()
51
59
#### Return Type
52
60
**Boolean**
53
61
54
-
true if the request should be rejected, false otherwise.
55
-
56
62
---
57
63
58
64
### `isEncodeError()`
59
65
60
66
Was unable to encode the captcha response. This means the captcha response
61
-
was invalid and should never be accepted.
67
+
was invalid and should never be accepted.
68
+
69
+
Returns rue if there was an encoding error, false otherwise.
62
70
63
71
#### Signature
64
72
```apex
@@ -68,14 +76,14 @@ global Boolean isEncodeError()
68
76
#### Return Type
69
77
**Boolean**
70
78
71
-
true if there was an encoding error, false otherwise.
72
-
73
79
---
74
80
75
81
### `isRequestError()`
76
82
77
83
Something went wrong making the request to the Friendly Captcha API, perhaps
78
-
there is a network connection issue?
84
+
there is a network connection issue?
85
+
86
+
Returns true if there was a request error, false otherwise.
79
87
80
88
#### Signature
81
89
```apex
@@ -85,13 +93,13 @@ global Boolean isRequestError()
85
93
#### Return Type
86
94
**Boolean**
87
95
88
-
true if there was a request error, false otherwise.
89
-
90
96
---
91
97
92
98
### `isDecodeError()`
93
99
94
-
Something went wrong decoding the response from the Friendly Captcha API.
100
+
Something went wrong decoding the response from the Friendly Captcha API.
101
+
102
+
Returns true if there was a decoding error, false otherwise.
95
103
96
104
#### Signature
97
105
```apex
@@ -101,8 +109,6 @@ global Boolean isDecodeError()
101
109
#### Return Type
102
110
**Boolean**
103
111
104
-
true if there was a decoding error, false otherwise.
105
-
106
112
---
107
113
108
114
### `isClientError()`
@@ -111,7 +117,9 @@ Something went wrong on the client side, this generally means your
111
117
configuration is wrong.
112
118
Check your secrets (API key) and sitekey.
113
119
114
-
See `response.error` for more details.
120
+
See `response.error` for more details.
121
+
122
+
Returns true if there was a client error, false otherwise.
115
123
116
124
#### Signature
117
125
```apex
@@ -121,14 +129,14 @@ global Boolean isClientError()
121
129
#### Return Type
122
130
**Boolean**
123
131
124
-
true if there was a client error, false otherwise.
125
-
126
132
---
127
133
128
134
### `getResponse()`
129
135
130
136
Get the response as was sent from the server.
131
-
This can be null if the request to the API could not be made successfully.
137
+
This can be null if the request to the API could not be made successfully.
138
+
139
+
Returns the response from the server, or null if the request failed.
132
140
133
141
#### Signature
134
142
```apex
@@ -138,13 +146,13 @@ global VerifyResponse getResponse()
138
146
#### Return Type
139
147
**[VerifyResponse](VerifyResponse)**
140
148
141
-
the response from the server, or null if the request failed.
142
-
143
149
---
144
150
145
151
### `getErrorCode()`
146
152
147
-
Get the error code.
153
+
Get the error code.
154
+
155
+
Returns the error code, or null if not present.
148
156
149
157
#### Signature
150
158
```apex
@@ -154,13 +162,13 @@ global String getErrorCode()
154
162
#### Return Type
155
163
**String**
156
164
157
-
the error code, or null if not present.
158
-
159
165
---
160
166
161
167
### `getErrorDetail()`
162
168
163
-
Get the error detail.
169
+
Get the error detail.
170
+
171
+
Returns the error detail, or null if not present.
164
172
165
173
#### Signature
166
174
```apex
@@ -170,16 +178,16 @@ global String getErrorDetail()
170
178
#### Return Type
171
179
**String**
172
180
173
-
the error detail, or null if not present.
174
-
175
181
---
176
182
177
183
### `wasAbleToVerify()`
178
184
179
185
Whether the request to verify the captcha was completed. In other words: the
180
186
API responded with status 200.
181
187
If this is false, you should notify yourself and check `getErrorCode()` to see
182
-
what is wrong.
188
+
what is wrong.
189
+
190
+
Returns true if the request was able to be verified, false otherwise.
183
191
184
192
#### Signature
185
193
```apex
@@ -189,13 +197,13 @@ global Boolean wasAbleToVerify()
189
197
#### Return Type
190
198
**Boolean**
191
199
192
-
true if the request was able to be verified, false otherwise.
193
-
194
200
---
195
201
196
202
### `getException()`
197
203
198
-
Get the exception that was thrown, if any.
204
+
Get the exception that was thrown, if any.
205
+
206
+
Returns the exception, or null if none was thrown.
199
207
200
208
#### Signature
201
209
```apex
@@ -205,7 +213,5 @@ global Exception getException()
0 commit comments