diff --git a/docs-v2/integrate/guides/advanced/secure-frontend-sdk.mdx b/docs-v2/integrate/guides/advanced/secure-frontend-sdk.mdx index 1ca792e7318..c077137c1b7 100644 --- a/docs-v2/integrate/guides/advanced/secure-frontend-sdk.mdx +++ b/docs-v2/integrate/guides/advanced/secure-frontend-sdk.mdx @@ -21,7 +21,8 @@ import * as crypto from 'node:crypto'; // Enforce backend authentication before generating the HMAC digest. const hmac = crypto.createHmac('sha256', ''); // HMAC key set in your environment settings. -hmac.update(':'); +hmac.update(''); +// hmac.update(':'); if explicitly setting the connection id const digest = hmac.digest('hex'); ``` @@ -35,7 +36,8 @@ import hashlib # HMAC key set in your environment settings. hmac_key = '' -message = ':' +message = '' +# message = ':' if explicitly setting the connection id digest = hmac.new(hmac_key.encode('utf-8'), msg=message.encode('utf-8'), digestmod=hashlib.sha256).hexdigest() ``` @@ -53,7 +55,8 @@ import java.security.NoSuchAlgorithmException; public class Main { public static void main(String[] args) throws NoSuchAlgorithmException, InvalidKeyException { String hmacKey = ""; - String message = ":"; + String message = ""; + // String message = ":"; if explicitly setting the connection id Mac hmac = Mac.getInstance("HmacSHA256"); SecretKeySpec secret_key = new SecretKeySpec(hmacKey.getBytes(), "HmacSHA256"); @@ -79,7 +82,8 @@ public class Main { require 'openssl' hmac_key = '' -message = ':' +message = '' +# message = ':' if explicitly setting the connection id digest = OpenSSL::HMAC.hexdigest('SHA256', hmac_key, message) ``` @@ -99,7 +103,8 @@ import ( func main() { hmacKey := "" - message := ":" + message := "" + // message := ":" if explicitly setting the connection id hmac := hmac.New(sha256.New, []byte(hmacKey)) hmac.Write([]byte(message)) @@ -119,7 +124,8 @@ use sha2::Sha256; type HmacSha256 = Hmac; let hmac_key = ""; -let message = ":"; +let message = ""; +// let message = ":"; if explicitly setting the connection id let mut mac = HmacSha256::new_varkey(hmac_key.as_bytes()).expect("HMAC can take key of any size"); mac.update(message.as_bytes()); @@ -134,7 +140,8 @@ let digest = hex::encode(result.into_bytes()); ```php '; -$message = ':'; +$message = ':'; +// $message = ':'; if explicitly setting the connection id $digest = hash_hmac('sha256', $message, $hmacKey); ?> @@ -151,7 +158,7 @@ Your backend should keep the secret HMAC key private and not reveal it to your f In the frontend, pass the HMAC signature in `nango.auth()` ([reference](/reference/sdks/frontend#collect-and-store-end-user-credentials)): ```ts -nango.auth('', '', { hmac: '' }); +nango.auth('', { hmac: '' }); ``` Enable the HMAC checkbox in the _Environment Settings_ tab in the Nango UI. diff --git a/docs-v2/reference/sdks/frontend.mdx b/docs-v2/reference/sdks/frontend.mdx index a955096fca0..c6d1fe3ce79 100644 --- a/docs-v2/reference/sdks/frontend.mdx +++ b/docs-v2/reference/sdks/frontend.mdx @@ -58,7 +58,7 @@ You store end-user credentials with the `nango.auth` method. It creates a [conne For OAuth, this will open a modal to let the user log in to their external account. ```js -const result = await nango.auth('', '').catch((error) => { +const result = await nango.auth('').catch((error) => { ... }); ``` @@ -70,7 +70,7 @@ const result = await nango.auth('', '').catch((er For API key authorization, pass the end-user's previously-collected API key directly in the parameters. ```js -const result = await nango.auth('', '', { +const result = await nango.auth('', { credentials: { apiKey: '' } }).catch((error) => { ... @@ -84,7 +84,7 @@ const result = await nango.auth('', '', { For Basic Auth, pass the end-user's previously-collected username & password in the parameters. ```js -const result = nango.auth('', '', { +const result = nango.auth('', { credentials: { username: '', password: '' } }).catch((error) => { ... @@ -100,7 +100,7 @@ const result = nango.auth('', '', { The integration ID that you can find in the integration settings on the Nango UI. - + The connection ID that you can find in the _Connections_ tab on the Nango UI. diff --git a/docs-v2/spec.yaml b/docs-v2/spec.yaml index 62bc9dfd750..d4255c480ef 100644 --- a/docs-v2/spec.yaml +++ b/docs-v2/spec.yaml @@ -439,15 +439,14 @@ paths: schema: type: object required: - - connection_id - provider_config_key properties: - connection_id: - type: string - description: The connection ID used to create the connection. provider_config_key: type: string description: The integration ID that you created on Nango. + connection_id: + type: string + description: The connection ID used to create the connection. access_token: type: string description: (OAuth 2, required) Existing access token.