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

De LATROMI Manuais
Ir para: navegação, pesquisa
(Web Service REST)
(ChangePassword)
 
(25 revisões intermediárias pelo mesmo usuário não estão sendo mostradas)
Linha 1: Linha 1:
 
== Sobre ==
 
== 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 ==
 
== Web Service REST ==
Linha 10: Linha 13:
 
| 100  
 
| 100  
 
| Sucess
 
| Sucess
|
+
| Operação realizada com sucesso.
 
|-  
 
|-  
 
| 201
 
| 201
Linha 53: Linha 56:
 
|}
 
|}
  
 +
=== Authenticate2 ===
 +
 +
* Verbo Http: POST
 +
* Template de URL: {latromiUrl}/Services/Authentication.svc/rest/authenticate2/
 +
* 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>.''
 +
 +
'''JSON de entrada'''
 +
<syntaxhighlight lang="Json">
 +
 +
  "username": string,
 +
  "password": string
 +
}</syntaxhighlight>
 +
 +
'''JSON de Retorno'''
 +
<syntaxhighlight lang="Json">
 +
{
 +
    "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
 +
            }
 +
        ]
 +
    }
 +
}
 +
</syntaxhighlight>
 +
 +
-----
  
 
=== Authenticate ===
 
=== Authenticate ===
Linha 60: Linha 126:
 
* Exemplo: http://samples.latromi.com.br/AuthToken/
 
* Exemplo: http://samples.latromi.com.br/AuthToken/
  
Serviço de autenticação de usuário. Passar no parâmetro '''requestToken''' o token gerado pelo serviço [[TokenGenService.svc|generateAuthResquestToken]].
+
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]].
  
<pre>
+
'''JSON de Retorno'''
 +
<syntaxhighlight lang="Json">
 
{
 
{
 
     "status": 100,
 
     "status": 100,
Linha 106: Linha 173:
 
     }
 
     }
 
}
 
}
</pre>
+
</syntaxhighlight>
 +
 
 +
-----
  
 
=== ValidateAuthToken ===
 
=== ValidateAuthToken ===
Linha 113: Linha 182:
 
* Template de URL: {latromiUrl}/Services/Authentication.svc/rest/validateAuthToken/{authToken}
 
* Template de URL: {latromiUrl}/Services/Authentication.svc/rest/validateAuthToken/{authToken}
 
* Exemplo: http://samples.latromi.com.br/validatetoken
 
* Exemplo: http://samples.latromi.com.br/validatetoken
 +
 +
'''JSON de Retorno'''
 +
<syntaxhighlight lang="Json">
 +
{
 +
    "status": 100,
 +
    "message": "Sucesso.",
 +
    "details": null
 +
}
 +
</syntaxhighlight>
 +
 +
-----
  
 
=== EndSession ===
 
=== EndSession ===
Linha 118: Linha 198:
 
* Verbo Http: GET
 
* Verbo Http: GET
 
* Template de URL: {latromiUrl}/Services/Authentication.svc/rest/endSession/{authToken}
 
* Template de URL: {latromiUrl}/Services/Authentication.svc/rest/endSession/{authToken}
 +
 +
'''JSON de Retorno'''
 +
<syntaxhighlight lang="Json">
 +
{
 +
    "status": 100,
 +
    "message": "Sucesso.",
 +
    "details": null
 +
}
 +
</syntaxhighlight>
 +
 +
-----
  
 
=== ChangePassword ===
 
=== ChangePassword ===
Linha 124: Linha 215:
 
* Template de URL: {latromiUrl}/Services/Authentication.svc/rest/changePassword/{requestToken}
 
* Template de URL: {latromiUrl}/Services/Authentication.svc/rest/changePassword/{requestToken}
 
* Exemplo: http://samples.latromi.com.br/changePassword
 
* Exemplo: http://samples.latromi.com.br/changePassword
 +
 +
Serviço de troca de senha do usuário. Passar no parâmetro '''requestToken''' o token gerado pelo serviço [[TokenGenService.svc|GenerateChangePasswordToken]].
 +
 +
'''JSON de Retorno'''
 +
<syntaxhighlight lang="Json">
 +
{
 +
    "status": 100,
 +
    "message": "Sucesso.",
 +
    "details": null
 +
}
 +
</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
}