Per assicurare l’alto livello di sicurezza per i casi in cui l’app di Crowdin funziona con i dati da Crowdin Imprese (es. usa l’autorizzazione tramite authorization_code
), abbiamo sviluppato un meccanismo di sicurezza. Il principio principale di questo meccanismo di sicurezza è basato sullo scambio del token JWT tra Crowdin Imprese e l’app di Crowdin. JWT token is signed with an OAuth Client Secret known only to the two final parties. Così, l’app di Crowdin può ottenere una conferma che la pagina è aperta precisamente su Crowdin Imprese.
To implement the authorization and authentication in your Crowdin app, follow these steps:
authorization_code
to your app descriptor and add the OAuth Client ID that will be used for authorization.Usando i metodi suddetti, a ogni richiesta all’app di Crowdin, Crowdin Imprese passerà una serie di parametri insieme a un token di sicurezza, convalidabile da un segreto da OAuth.
Sotto puoi consultare un’esempio dell’URL usato da Crowdin Imprese per aprire una pagina del modulo.
Query parameters:
jwtToken | Type: Description: JWT token used for authorization. |
origin | Type: Description: Host used for opening a module page. |
clientId | Type: Description: The ID of the OAuth Client used for authorization. |
The best practice would be adding middleware to the Crowdin app to verify whether each request has a token with a valid signature and expiry. You can use one of the existing libraries to validate the authenticity of the token.
JWT token consists of the following parts:
JWT token payload example:
{
"aud": "Br4a2hpQiNW96anuuO4a",
"sub": "1",
"domain": null,
"context": {},
"iat": 1600000000,
"exp": 1600000900
}
Properties:
aud | Type: Description: ID of the OAuth Client that issued the token. |
sub | Type: Description: Identifier of the user that is making a request to the Crowdin app. |
domain | Type: Required: yes Description: The name of the organization from which the app is accessed. |
contesto | Type: Descrizione: Le informazioni sull'ambiente in cui è aperto il modulo dell'app di Crowdin (es., progetto, organizzazione, locale, fuso orario dell'utente, etc.). |
iat | Type: Description: Identifies the issue time of the token. |
exp | Type: Description: Identifies the expiration time of the token. |
Se hai configurato una lista di IP consentiti per la tua organizzazione di Crowdin Imprese, devi aggiungere il tuo indirizzo IP dell’app di Crowdin alla lista di IP consentiti della tua organizzazione. Inoltre, implementa la stessa lista di IP consentiti nella tua app di Crowdin per una maggiore sicurezza. In questo caso, assicurati di aggiungere i seguenti indirizzi IP di Crowdin Imprese: