Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
POST https://auth-staging.sagebase.org/auth/v1/session
{"email":"demouser@sagebase.org", "password":"demouser-pw"}

or

Code Block
POST https://auth-staging.sagebase.org/auth/v1/session
{"email":"demouser@sagebase.org", "password":"demouser-pw", "acceptsTermsOfUse":"true"}

 

Successful Response:

Code Block
HTTP/1.1 201 Created
Content-Type: application/json
{"displayName":"Demo User","sessionToken":"AYcOhWIm9NdOC6BdzzzisQ00"}

...

Code Block
HTTP/1.1 400 Bad Request
AuthenticationURL: https://auth-staging.sagebase.org/auth/v1/session
Content-Type: application/json
{"reason":"Unable to authenticate."}

Session token is valid for a period of time, currently set to 24 hours.

Refresh Token (reset timer)

Request:

Code Block
PUT https://auth-staging.sagebase.org/auth/v1/session
{"sessionToken":"AYcOhWIm9NdOC6BdzzzisQ00"}

...

 

Error Response, if the Terms of Use are not either accepted explicitly in the request or accepted by the user previously:

Code Block
HTTP/1.1 403 Forbidden
Content-Type: application/json
{"reason":"You must sign the Synapse terms of use."}

The API for retrieving the text of the terms of use is given below.

 

Session token is valid for a period of time, currently set to 24 hours.

Refresh Token (reset timer)

Request:

Code Block
PUT https://auth-staging.sagebase.org/auth/v1/session
{"sessionToken":"AYcOhWIm9NdOC6BdzzzisQ00"}

Successful Response:

Code Block
HTTP/1.1 204 No Content

...

and a plain text body:  "The token provided was invalid or expired."

API for Terms of Use

All authenticated requests to the Synapse repository service must be by a user who has signed A user may not initiate a session until they agree to the Synapse Terms of Use.  This API allows retrieval of the terms.

Get the Terms of Use

Code Block
GET https://auth-staging.sagebase.org/auth/v1/termsOfUse

...

Code Block
HTTP/1.1 200 OK

<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns:mv="http://macVmlSchemaUri" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta name=Title content="Synapse Terms and Conditions of Use">
<meta name=Keywords content="">
...
</html>

 

Check whether the authenticated user agrees to the Terms of Use

Code Block
GET https://auth-staging.sagebase.org/auth/v1/termsOfUseAgreement

Successful Response:

Code Block
HTTP/1.1 200 OK
Content-Type: application/json
{
    "agrees": "false"
}
 

Set whether the authenticated user agrees to the Terms of Use

Code Block
POST https://auth-staging.sagebase.org/auth/v1/termsOfUseAgreement
{"agrees": "true"}

Successful Response:

Code Block
HTTP/1.1 201 Created
 xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta name=Title content="Synapse Terms and Conditions of Use">
<meta name=Keywords content="">
...
</html>

 

 

API for Authorization

Default groups

...