Authentication via Token
Introduction
This manual describes the authentication procedure via Token from the SPID Client to the SPID Server.
Procedure
Access the server where the SPID Server is, open the file user.json
. In this file, add a username and password or edit a user that will not compromise the operation of SPID. Note that the password must be encrypted in SHA-256.
Example of how the file section should look, considering a user called “griaule” and the password “teste”:
{
"user": "griaule",
"pass": 46070d4bf934fb0d4b06d9e2c46e346944e322444900a435d7d9a95e6d7435f5,
"role": [
"ROLE_ADMIN",
"ROLE_USER"
]
}
Do not remove the other users from this file; removal may compromise the application's operation.
On the SPID Client machine, go to C:\Griaule\SPID_Griaule\jre\bin
and run the encrypt.jar file with the password chosen in the previous step.
.\java.exe -jar .\encrypt.jar teste
If everything goes correctly, the response should be, for the password teste
:
Encrypted password is: 2JnIAzJa4ZwiamcKOAnJNg==
Open the file GBSSpid2.properties
in the folder C:\Griaule\SPID\conf\
and insert the encrypted password in the field server.password
.
#GBDS Server connection
server.url=<URL>
server.username=griaule
server.password=2JnIAzJa4ZwiamcKOAnJNg==
On the server machine, restart the SPID Server.
sudo service spid restart
Open SPID Services; if the process is successful, the server will show the following message:
{
"event": "Authorization",
"eventResult": "JWT Token Authorized"
}
Last updated
Was this helpful?