This helper is used to generate/sign tickets & validate/get data after successful login through VIISP (https://epaslaugos.lt).
- Send request to this handler to create a new ticket.
- Redirect user to
epaslaugos.lt
- After successful login, user is redirected to
login.biip.lt
(POST request - check handler) - Login handler redirects user by
customData.host
prop to some other url - That endpoint extracts data through API and this handler.
Endpoint | Description | Params | Info | Returns |
---|---|---|---|---|
POST /auth/sign |
Generates new ticket | host (required) optionally - pass any data and it will be returned in customData afterwards |
host param needed for login.biip.lt to redirect signed in user |
JSON that contains: 1. ticket - generated ticket ID.2. host - epaslaugos url 3. url - concatinated url to redirect user |
GET /auth/data?ticket=... |
Gets signed in user/company data. Valid to call after successful sign in. | ticket (required) |
ticket has to be previously generated ticket ID. |
All avilable data such as firstName , lastName , lt-personal-code , etc as JSON. |
Variable name | Description |
---|---|
VIISP_PID |
VIISP unique service ID, e.g. VSID000000000000 |
VIISP_POSTBACK_URL |
VIISP postback URL, e.g. https://website.com/ |
KEYSTORE_BASE64 |
JKS keystore encoded as base64 |
KEYSTORE_PASSWORD |
JKS keystore password |
After ticket is generated you can:
- Create a form that redirects user to sign in. In example bellow - underscored variables are results from the request.
<form method="POST" action="_host_">
<input type="hidden" value="_ticket_" name="ticket" />
<button type="submit">Sign In</button>
</form>
- Redirect user directly to
url
endpoint.
After successfull sign in user is redirected to some specific url. This is done by login.biip.lt
by customData.host
prop. ticket
and customData
are stored as query parameters after redirect.
docker-compose up --build
// OR
mvn spring-boot:run // needs setup to work properly (or hacks)
- EPaslaugos website (LT)
- To understand how it works (LT)
- Certificates are valid up until 2121
💡 Note: replace all <...>
variables with your own.
- Convert
jks
top12
.
keytool -importkeystore -srckeystore <keystore.jks> -destkeystore <keystore.p12> -srcstoretype JKS -deststoretype PKCS12 -deststorepass <p12_password>
- Convert
p12
tobase64
base64 -i <keystore.p12>
- Congrats! 🎉 Now use this base64 value as
KEYSTORE_BASE64
and<p12_password>
asKEYSTORE_PASSWORD