This endpoint is the simplest way to login into your Siga 3 account. When logged it will return the Siga 3 server it's using, the Siga session cookie, your client session cookie, and a logged variable equal to true meaning you successfully logged into your Siga 3 account.
Load the Siga
This method requires u to have a loaded Siga session:
If you need or want to log in using captcha, u need to load a Siga session with captcha data:
With the Siga session loaded, you should have the following values:
challenge The challenge hash.
captcha Will be null if loaded without captcha
id Captcha identifier
numbers An array of the captcha values
tip A tip on what to do with the captcha values
server Base Siga URL given by Siga's load balancer
siga Siga session id
client MySiga session id
Encrypting the password
This login method doesn't accept the user password, u have to encrypt the password using the given challenge hash and use the generated hash to log in. This is the way to do it:
MD5(user : MD5(password) : challenge)
$cpf ='12345678901';$password ='12345678';$challenge ='1816466375646a6b2518ae6';$response =md5($cpf.':'.md5($password).':'.$challenge);// response will be like: 2717466375646a6b8518ae7
Raw Authentication
POSThttps://mysiga.laravieira.me/login/raw
This will get the CPF and the response and login into Siga server.
server Base URL to the Siga 3 server selected by Siga's load balancer.
siga Siga session id.
client Session id of MySiga API.
logged If the user was logged in, is always true and only exists on the 200 response code.
The value to the CPF field is missing or not a valid CPF.
{"code":400,"message":"No valid CPF.","uri":"/login","server":null,"siga":null,"client":"*","docs":"https://docs.laravieira.me/mysiga","date":"Sun, 21 May 2023 13:41:34 -0300"}
The given value to the response field is not valid or is missing.
{"code":400,"message":"No valid response.","uri":"/login","server":null,"siga":null,"client":"*","docs":"https://docs.laravieira.me/mysiga","date":"Sun, 21 May 2023 13:45:50 -0300"}
The given captcha resolution is not valid.
{"code":400,"message":"No valid captcha.","uri":"/login","server":null,"siga":null,"client":"*","docs":"https://docs.laravieira.me/mysiga","date":"Sun, 21 May 2023 13:41:34 -0300"}
{"code":401,"message":"This CPF isn't registered in Siga servers.","uri":"/login","server":null,"siga":null,"client":"*","docs":"https://docs.laravieira.me/mysiga","date":"Sun, 21 May 2023 13:41:34 -0300"}
The given response field doesn't match the hash for the given challenge, or u encrypted it wrongly or the password is wrong.
{"code":401,"message":"Wrong Password.","uri":"/login","server":null,"siga":null,"client":"*","docs":"https://docs.laravieira.me/mysiga","date":"Sun, 21 May 2023 13:41:34 -0300"}
{"code":401,"message":"Captcha wrong.","uri":"/login","server":null,"siga":null,"client":"*","docs":"https://docs.laravieira.me/mysiga","date":"Sun, 21 May 2023 13:41:34 -0300"}
{"code":424,"message":"You need to load a siga session before trying login.","uri":"/login","server":null,"siga":null,"client":"*","docs":"https://docs.laravieira.me/mysiga","date":"Sun, 21 May 2023 13:41:34 -0300"}
{"code":424,"message":"You need to load a siga captcha before trying login with it.","uri":"/login","server":null,"siga":null,"client":"*","docs":"https://docs.laravieira.me/mysiga","date":"Sun, 21 May 2023 13:41:34 -0300"}
{"code":401,"message":"Captcha required.","uri":"/login","server":null,"siga":null,"client":"*","docs":"https://docs.laravieira.me/mysiga","date":"Sun, 21 May 2023 13:41:34 -0300"}
If your response is an exception not listed here, u might wanna checkGeneral Exceptions.