- Home
- Resources
- AuthenticationResource
Authentication Resource. This can be used to authenticate an existing SID.
GET /auth/globalprefix
Returns the global prefix
Response Body
media type |
data type |
description |
application/json |
GenericResponse
(JSON) |
GenericResponse |
Example
Request
GET /auth/globalprefix
Accept: application/json
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"messages" : [ { }, { } ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}
POST /auth/hashpassword
Create a hash of the given password and userID
The hashing algorithm can change at any time. As this method is possibly
expensive (depends on the implemented hash algorithm), we don't allow
anonymous access to it.
Request Parameters
name |
type |
description |
default |
constraints |
sid |
query |
|
0 |
int |
Request Body
media type |
data type |
description |
application/json |
HashPasswordRequest
(JSON) |
Password request object |
Response Body
media type |
data type |
description |
application/json |
HashPasswordResponse
(JSON) |
HashPasswordResponse |
Example
Request
POST /auth/hashpassword
Content-Type: application/json
Accept: application/json
{
"password" : "...",
"userId" : 12345
}
Response
HTTP/1.1 201 Created
Content-Type: application/json
{
"hash" : "...",
"user" : {
"id" : 12345,
"firstName" : "...",
"lastName" : "...",
"description" : "...",
"email" : "...",
"groups" : [ {
"id" : 12345,
"name" : "...",
"description" : "...",
"children" : [ { }, { } ]
}, {
"id" : 12345,
"name" : "...",
"description" : "...",
"children" : [ { }, { } ]
} ],
"login" : "...",
"password" : "..."
},
"messages" : [ { }, { } ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}
GET /auth/login
Perform a login to the system with SSO systems
Response Body
media type |
data type |
description |
text/plain;charset=UTF-8 |
(custom)
|
SID or "NOTFOUND" or "FAILURE" |
Example
Request
GET /auth/login
Accept: text/plain;charset=UTF-8
Response
HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
...
POST /auth/login
Perform a login to the system based on user credentials.
If the user is successfully authenticated, create a new session and send back the sid.
If a new sessionSecret is created, set it as a cookie
Request Parameters
name |
type |
description |
default |
sid |
query |
Optional: Existing sid number, the stored secret must match the cookie |
0 |
Request Body
media type |
data type |
description |
application/json |
LoginRequest
(JSON) |
login request (contains the login credentials) |
Response Body
media type |
data type |
description |
application/json |
LoginResponse
(JSON) |
login response |
Example
Request
POST /auth/login
Content-Type: application/json
Accept: application/json
{
"login" : "...",
"password" : "..."
}
Response
HTTP/1.1 201 Created
Content-Type: application/json
{
"sid" : "...",
"user" : {
"id" : 12345,
"firstName" : "...",
"lastName" : "...",
"description" : "...",
"email" : "...",
"groups" : [ {
"id" : 12345,
"name" : "...",
"description" : "...",
"children" : [ { }, { } ]
}, {
"id" : 12345,
"name" : "...",
"description" : "...",
"children" : [ { }, { } ]
} ],
"login" : "...",
"password" : "..."
},
"messages" : [ { }, { } ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}
POST /auth/loginwithrsa
Perform a login to the system based on RSA signature.
If the user is successfully authenticated, create a
new session and send back the sid.
If a new sessionSecret is created, set it as a cookie.
Request Parameters
name |
type |
description |
default |
sid |
query |
Optional: Existing sid number, the stored secret must match the cookie |
0 |
Request Body
media type |
data type |
description |
application/json |
LoginWithRsaRequest
(JSON) |
login request (contains the login credentials) |
Response Body
media type |
data type |
description |
application/json |
LoginResponse
(JSON) |
login response |
Example
Request
POST /auth/loginwithrsa
Content-Type: application/json
Accept: application/json
{
"username" : "...",
"salt" : "...",
"expirationTimestamp" : 12345,
"rsaSignature" : "..."
}
Response
HTTP/1.1 201 Created
Content-Type: application/json
{
"sid" : "...",
"user" : {
"id" : 12345,
"firstName" : "...",
"lastName" : "...",
"description" : "...",
"email" : "...",
"groups" : [ {
"id" : 12345,
"name" : "...",
"description" : "...",
"children" : [ { }, { } ]
}, {
"id" : 12345,
"name" : "...",
"description" : "...",
"children" : [ { }, { } ]
} ],
"login" : "...",
"password" : "..."
},
"messages" : [ { }, { } ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}
POST /auth/matchpassword
Checks if the given password matches the given hash
As this method is possibly expensive (depends on the implemented hash algorithm),
we don't allow anonymous access to it.
Request Parameters
name |
type |
description |
default |
constraints |
sid |
query |
|
0 |
int |
Request Body
media type |
data type |
description |
application/json |
MatchPasswordRequest
(JSON) |
Password match request object |
Response Body
media type |
data type |
description |
application/json |
GenericResponse
(JSON) |
GenericResponse |
Example
Request
POST /auth/matchpassword
Content-Type: application/json
Accept: application/json
{
"password" : "...",
"hash" : "..."
}
Response
HTTP/1.1 201 Created
Content-Type: application/json
{
"messages" : [ { }, { } ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}
GET /auth/ssologin
Perform a login to the system with SSO systems
Response Body
media type |
data type |
description |
text/plain;charset=UTF-8 |
(custom)
|
SID or "NOTFOUND" or "FAILURE" |
Example
Request
GET /auth/ssologin
Accept: text/plain;charset=UTF-8
Response
HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
...
POST /auth/logout/{sid}
Do a logout for the current session
Request Parameters
name |
type |
description |
default |
constraints |
sid |
path |
|
|
|
allSessions |
query |
|
0 |
boolean |
Response Body
media type |
data type |
description |
application/json |
GenericResponse
(JSON) |
generic response |
Example
Request
POST /auth/logout/{sid}
Accept: application/json
Response
HTTP/1.1 201 Created
Content-Type: application/json
{
"messages" : [ { }, { } ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}
GET /auth/validate/{sid}
Validate the given SID
Request Parameters
name |
type |
description |
sid |
path |
sid + gcn_session_secret (taken from the GCN_SESSION_SECRET cookie) to validate |
Response Body
media type |
data type |
description |
application/json |
AuthenticationResponse
(JSON) |
response containing validation result and (possibly) a user |
Example
Request
GET /auth/validate/{sid}
Accept: application/json
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"user" : {
"id" : 12345,
"firstName" : "...",
"lastName" : "...",
"description" : "...",
"email" : "...",
"groups" : [ {
"id" : 12345,
"name" : "...",
"description" : "...",
"children" : [ { }, { } ]
}, {
"id" : 12345,
"name" : "...",
"description" : "...",
"children" : [ { }, { } ]
} ],
"login" : "...",
"password" : "..."
},
"messages" : [ { }, { } ],
"responseInfo" : {
"responseCode" : "OK",
"responseMessage" : "...",
"property" : "..."
}
}