Mudanças entre as edições de "Authentication.svc"

De LATROMI Manuais
Ir para: navegação, pesquisa
(Authenticate2)
(ChangePassword)
 
(3 revisões intermediárias pelo mesmo usuário não estão sendo mostradas)
Linha 60: Linha 60:
 
* Verbo Http: POST
 
* Verbo Http: POST
 
* Template de URL: {latromiUrl}/Services/Authentication.svc/rest/authenticate2/
 
* Template de URL: {latromiUrl}/Services/Authentication.svc/rest/authenticate2/
* Exemplo: http://samples.latromi.com.br/Auth/
+
* Exemplo: https://samples.latromi.com.br/Auth/
  
 
Serviço de autenticação de usuário. Este serviço só é recomendado quando o site está usando o protocolo <span style="color:#00cc00"><b>Https</b></span>.''
 
Serviço de autenticação de usuário. Este serviço só é recomendado quando o site está usando o protocolo <span style="color:#00cc00"><b>Https</b></span>.''
  
 
'''JSON de entrada'''
 
'''JSON de entrada'''
<pre>
+
<syntaxhighlight lang="Json">
 
{   
 
{   
 
   "username": string,
 
   "username": string,
 
   "password": string
 
   "password": string
}</pre>
+
}</syntaxhighlight>
  
 
'''JSON de Retorno'''
 
'''JSON de Retorno'''
<pre>
+
<syntaxhighlight lang="Json">
 
{
 
{
 
     "status": 100,
 
     "status": 100,
Linha 116: Linha 116:
 
     }
 
     }
 
}
 
}
</pre>
+
</syntaxhighlight>
 +
 
 +
-----
  
 
=== Authenticate ===
 
=== Authenticate ===
Linha 127: Linha 129:
  
 
'''JSON de Retorno'''
 
'''JSON de Retorno'''
<pre>
+
<syntaxhighlight lang="Json">
 
{
 
{
 
     "status": 100,
 
     "status": 100,
Linha 171: Linha 173:
 
     }
 
     }
 
}
 
}
</pre>
+
</syntaxhighlight>
 +
 
 +
-----
  
 
=== ValidateAuthToken ===
 
=== ValidateAuthToken ===
Linha 180: Linha 184:
  
 
'''JSON de Retorno'''
 
'''JSON de Retorno'''
<pre>
+
<syntaxhighlight lang="Json">
 
{
 
{
 
     "status": 100,
 
     "status": 100,
Linha 186: Linha 190:
 
     "details": null
 
     "details": null
 
}
 
}
</pre>
+
</syntaxhighlight>
 +
 
 +
-----
  
 
=== EndSession ===
 
=== EndSession ===
Linha 194: Linha 200:
  
 
'''JSON de Retorno'''
 
'''JSON de Retorno'''
<pre>
+
<syntaxhighlight lang="Json">
 
{
 
{
 
     "status": 100,
 
     "status": 100,
Linha 200: Linha 206:
 
     "details": null
 
     "details": null
 
}
 
}
</pre>
+
</syntaxhighlight>
 +
 
 +
-----
  
 
=== ChangePassword ===
 
=== ChangePassword ===
Linha 211: Linha 219:
  
 
'''JSON de Retorno'''
 
'''JSON de Retorno'''
<pre>
+
<syntaxhighlight lang="Json">
 
{
 
{
 
     "status": 100,
 
     "status": 100,
Linha 217: Linha 225:
 
     "details": null
 
     "details": null
 
}
 
}
</pre>
+
</syntaxhighlight>

Edição atual tal como às 11h44min de 3 de setembro de 2019

Sobre

Serviço com operações relacionadas a sessão do usuário (autenticação, validação de ticket, troca de senha e logout).

Todos os serviços listados nesta página estão hospedados junto à instância do LATROMI Web. Portanto, o parâmetro {latromiUrl} presente nos Templates de URL listados abaixo, deve ser substituído pelo endereço do LATROMI Web (exemplo: http://latromi.minhaempresa.com.br/web).

Web Service REST

Códigos de Retorno (Status)
Código Nome Descrição
100 Sucess Operação realizada com sucesso.
201 UserOrPasswordInvalid
202 UserNotFound
203 InactiveUser
204 InvalidToken
205 ExpiredToken
206 AccessDenied
207 SessionNotFound
208 SessionIsClosed
209 IPAddressMismatch
999 Error

Authenticate2

Serviço de autenticação de usuário. Este serviço só é recomendado quando o site está usando o protocolo Https.

JSON de entrada

{  
   "username": string,
   "password": string
}

JSON de Retorno

{
    "status": 100,
    "message": "Usuário autenticado.",
    "details": null,
    "authToken": "IkXuQxepET......",
    "authType": 1,
    "userProfile": {
        "id": 1,
        "referenceCode": null,
        "username": "admin",
        "fullName": "Administrador",
        "emailAddress": "",
        "isActive": true,
        "isAdmin": true,
        "isIntegratedUser": false,
        "keepAliveEnabled": true,
        "documentType": 0,
        "documentNumber": "",
        "policies": null,
        "extendedProperties": [
            {
                "Key": "CampoLivre1",
                "Value": null
            },
            {
                "Key": "CampoLivre2",
                "Value": null
            },
            {
                "Key": "CampoLivre3",
                "Value": null
            },
            {
                "Key": "CampoLivre4",
                "Value": null
            },
            {
                "Key": "CampoLivre5",
                "Value": null
            }
        ]
    }
}

Authenticate

Serviço de autenticação de usuário alternativo para quem não possui certificado SSL. Passar no parâmetro requestToken o token gerado pelo serviço generateAuthResquestToken.

JSON de Retorno

{
    "status": 100,
    "message": "Usuário autenticado.",
    "details": null,
    "authToken": "IkXuQxepET......",
    "authType": 1,
    "userProfile": {
        "id": 1,
        "referenceCode": null,
        "username": "admin",
        "fullName": "Administrador",
        "emailAddress": "",
        "isActive": true,
        "isAdmin": true,
        "isIntegratedUser": false,
        "keepAliveEnabled": true,
        "documentType": 0,
        "documentNumber": "",
        "policies": null,
        "extendedProperties": [
            {
                "Key": "CampoLivre1",
                "Value": null
            },
            {
                "Key": "CampoLivre2",
                "Value": null
            },
            {
                "Key": "CampoLivre3",
                "Value": null
            },
            {
                "Key": "CampoLivre4",
                "Value": null
            },
            {
                "Key": "CampoLivre5",
                "Value": null
            }
        ]
    }
}

ValidateAuthToken

JSON de Retorno

{
    "status": 100,
    "message": "Sucesso.",
    "details": null
}

EndSession

  • Verbo Http: GET
  • Template de URL: {latromiUrl}/Services/Authentication.svc/rest/endSession/{authToken}

JSON de Retorno

{
    "status": 100,
    "message": "Sucesso.",
    "details": null
}

ChangePassword

Serviço de troca de senha do usuário. Passar no parâmetro requestToken o token gerado pelo serviço GenerateChangePasswordToken.

JSON de Retorno

{
    "status": 100,
    "message": "Sucesso.",
    "details": null
}