...
Create User
Code Block |
---|
POST httpshttp://ssl.latest.deflaux-test.appspotauth-sagebase-org.elasticbeanstalk.com/auth/v1/user {"userId":"demouser", "email":"demouser@sagebase.org", "firstName":"demo", "lastName":"user", "displayName":"Demo User"} |
...
Code Block |
---|
HTTP/1.1 400 Bad Request |
Update User
Code Block |
---|
PUT httpshttp://ssl.latest.deflaux-test.appspotauth-sagebase-org.elasticbeanstalk.com/auth/v1/user sessionToken:<sessionToken> {"userId":"demouser", "email":"demouser@sagebase.org", "firstName":"demo", "lastName":"user", "displayName":"Demo User"} |
...
Send Change-Password Email
Code Block |
---|
POST httpshttp://ssl.latest.deflaux-test.appspotauth-sagebase-org.elasticbeanstalk.com/auth/v1/userPasswordEmail {"userId":"demouser"} |
...
Initiate Session (Login)
Request:
Code Block |
---|
POST httpshttp://ssl.latest.deflaux-test.appspotauth-sagebase-org.elasticbeanstalk.com/auth/v1/session {"userId":"demouser", "password":"demouser-pw"} |
...
Code Block |
---|
HTTP/1.1 400 Bad Request AuthenticationURL: httpshttp://ssl.latest.deflaux-test.appspotauth-sagebase-org.elasticbeanstalk.com/auth/v1/session Content-Type: application/json {"reason":"Unable to authenticate."} |
...
Refresh Token (reset timer)
Request:
Code Block |
---|
PUT httpshttp://ssl.latest.deflaux-test.appspotauth-sagebase-org.elasticbeanstalk.com/auth/v1/session {"sessionToken":"AYcOhWIm9NdOC6BdzzzisQ00"} |
...
Terminate Session (Logout)
Request:
Code Block |
---|
DELETE httpshttp://ssl.latest.deflaux-test.appspotauth-sagebase-org.elasticbeanstalk.com/auth/v1/session {"sessionToken":"AYcOhWIm9NdOC6BdzzzisQ00"} |
...
Create User:
curl -k -H "Content-Type:application/json" -H "Accept:application/json" -d "{\"userId\":\"NEWuser\", \"email\":\"demouser@sagebase.org\", \"firstName\":\"demo\", \"lastName\":\"user\", \"displayName\":\"Demo User\"}" -X POST httpshttp://ssl.latest.deflaux-test.appspotauth-sagebase-org.elasticbeanstalk.com/auth/v1/user
Update User:
curl -k -H "Content-Type:application/json" -H "Accept:application/json" -d "{\"userId\":\"NEWuser\", \"email\":\"demouser@sagebase.org\", \"firstName\":\"NEWdemo\", \"lastName\":\"NEWuser\", \"displayName\":\"NEWDemo User\"}" -X PUT httpshttp://ssl.latest.deflaux-test.appspotauth-sagebase-org.elasticbeanstalk.com/auth/v1/user
Send Change Password Email:
curl -k -H "Content-Type:application/json" -H "Accept:application/json" -d "{\"userId\":\"demouser\"}" -X POST httpshttp://ssl.latest.deflaux-test.appspotauth-sagebase-org.elasticbeanstalk.com/auth/v1/userPasswordEmail
Login:
curl -k -H "Content-Type:application/json" -H "Accept:application/json" -d "{\"userId\":\"demouser\", \"password\":\"demouser-pw\"}" -X POST httpshttp://ssl.latest.deflaux-test.appspotauth-sagebase-org.elasticbeanstalk.com/auth/v1/session
Refresh session token:
curl -k -H "Content-Type:application/json" -H "Accept:application/json" -d "{\"sessionToken\":\"QYNoamrOKK0dBhjZOFfbAg00\"}" -X PUT httpshttp://ssl.latest.deflaux-test.appspotauth-sagebase-org.elasticbeanstalk.com/auth/v1/session
Logout:
curl -k -H "Content-Type:application/json" -H "Accept:application/json" -d "{\"sessionToken\":\"QYNoamrOKK0dBhjZOFfbAg00\"}" -X DELETE httpshttp://ssl.latest.deflaux-test.appspotauth-sagebase-org.elasticbeanstalk.com/auth/v1/session
Access repository services anonymously:
curl -H Accept:application/json http://localhost:8080/repo/v1/dataset/test
...
and a plain text body: "The token provided was invalid or expired."
API for Authorization
...
(Note, the URL may migrate from that of the repository services to a separate location.)
Create Group
Code Block |
---|
POST http://repositoryservice.sagebase.org/repo/v1/usergroup
{"name":"MyGroup"}
|
Retrieve Groups
Code Block |
---|
GET http://repositoryservice.sagebase.org/repo/v1/usergroup
|
Retrieve Group
Code Block |
---|
GET http://repositoryservice.sagebase.org/repo/v1/usergroup/\{id\}
|
Delete Group
Code Block |
---|
DELETE http://repositoryservice.sagebase.org/repo/v1/usergroup/\{id\}
|
Update Group (shallow properties, i.e. the group's name)
Code Block |
---|
PUT http://repositoryservice.sagebase.org/repo/v1/usergroup/\{id\}
{"name":"OurGroup"}
|
Add a user to the group
Code Block |
---|
PUT http://repositoryservice.sagebase.org/repo/v1/usergroup/{gid}/users/{uid}
|
Remove a user from the group
Code Block |
---|
DELETE http://repositoryservice.sagebase.org/repo/v1/usergroup/{gid}/users/{uid}
|
Get all the users in a group
Code Block |
---|
GET http://repositoryservice.sagebase.org/repo/v1/usergroup/{gid}/users
|
Give a group access to a resource, specifying the allowable access types:
Code Block |
---|
PUT http://repositoryservice.sagebase.org/repo/v1/usergroup/{gid}/resources/{rid}
{"accessType":["READ","CHANGE","SHARE"]}
|
Remove all access to a resource from a group
Code Block |
---|
DELETE http://repositoryservice.sagebase.org/repo/v1/usergroup/{gid}/resources/{rid}
|
Find out the access types a group has for a resource
Code Block |
---|
GET http://repositoryservice.sagebase.org/repo/v1/usergroup/{gid}/resources/{rid}
|