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

De LATROMI Manuais
Ir para: navegação, pesquisa
(ChangePassword)
 
(5 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/
* Recomendação: <span style="color:green"><b>Https</b></span>
 
  
Serviço de autenticação de usuário.  
+
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>.''
 
 
<span style="color:red">OBS: Não é recomendado o uso deste método quando o site não está usando o protocolo Https.</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 119: Linha 116:
 
     }
 
     }
 
}
 
}
</pre>
+
</syntaxhighlight>
 +
 
 +
-----
  
 
=== Authenticate ===
 
=== Authenticate ===
Linha 127: Linha 126:
 
* Exemplo: http://samples.latromi.com.br/AuthToken/
 
* Exemplo: http://samples.latromi.com.br/AuthToken/
  
Serviço de autenticação de usuário. Por uma questão de segurança, é recomendado o uso deste método quando o site não está usando o protocolo HTTPS.
+
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 [[TokenGenService.svc|generateAuthResquestToken]].
Passar no parâmetro '''requestToken''' o token gerado pelo serviço [[TokenGenService.svc|generateAuthResquestToken]].
 
  
 
'''JSON de Retorno'''
 
'''JSON de Retorno'''
<pre>
+
<syntaxhighlight lang="Json">
 
{
 
{
 
     "status": 100,
 
     "status": 100,
Linha 175: Linha 173:
 
     }
 
     }
 
}
 
}
</pre>
+
</syntaxhighlight>
 +
 
 +
-----
  
 
=== ValidateAuthToken ===
 
=== ValidateAuthToken ===
Linha 184: Linha 184:
  
 
'''JSON de Retorno'''
 
'''JSON de Retorno'''
<pre>
+
<syntaxhighlight lang="Json">
 
{
 
{
 
     "status": 100,
 
     "status": 100,
Linha 190: Linha 190:
 
     "details": null
 
     "details": null
 
}
 
}
</pre>
+
</syntaxhighlight>
 +
 
 +
-----
  
 
=== EndSession ===
 
=== EndSession ===
Linha 198: Linha 200:
  
 
'''JSON de Retorno'''
 
'''JSON de Retorno'''
<pre>
+
<syntaxhighlight lang="Json">
 
{
 
{
 
     "status": 100,
 
     "status": 100,
Linha 204: Linha 206:
 
     "details": null
 
     "details": null
 
}
 
}
</pre>
+
</syntaxhighlight>
 +
 
 +
-----
  
 
=== ChangePassword ===
 
=== ChangePassword ===
Linha 215: Linha 219:
  
 
'''JSON de Retorno'''
 
'''JSON de Retorno'''
<pre>
+
<syntaxhighlight lang="Json">
 
{
 
{
 
     "status": 100,
 
     "status": 100,
Linha 221: 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
}