Skip to content

Release v1.0.3

Choose a tag to compare

@remove158 remove158 released this 08 Nov 13:03
· 13 commits to master since this release

Features

  • Login with chula-sso-mock based on chula-sso
  • Select user roles
  • Validate user ticket

Preview

img

Configuration

The configuration is done by the following environment variables. (see docker run on how to set it)

Name Environment Variable Default
DeeAppId DEE_APP_ID test
DeeAppSecret DEE_APP_SECRET test
Port PORT 8080

Endpoint

GET /login

  • Request
curl --request GET \
  --url 'https://sso.piyaphat.com/login?service=https://www.google.com'
  • Response 302 Found
// (on-success) 302 Location: https://www.google.com?ticket=86966dc5-2049-428f-88fe-2d78a5985d38
  • Response 400 Bad Request
{
	"error": "Key: 'GetLoginRequest.Service' Error:Field validation for 'Service' failed on the 'required' tag"
}

GET, POST /serviceValidation

  • Request
curl --request POST \
  --url 'https://sso.piyaphat.com/serviceValidation' \
  --header 'DeeAppId: test' \
  --header 'DeeAppSecret: test' \
  --header 'DeeTicket: 1b50cf0d-ceed-46da-a672-4c61060ece8d'
  • Response 200 (application/json)
{
	"uid": "6000000021",
	"username": "6000000021",
	"gecos": "admin",
	"password": "123456",
	"disable": false,
	"roles": ["faculty"],
	"firstname": "Faculty",
	"lastname": "จุฬา",
	"firstnameth": "คณะ",
	"lastnameth": "จุฬา",
	"ouid": "6000000021",
	"email": "[email protected]"
}
  • Response 401 Unauthorized
{
	"error": "ticket not found"
}