Login & Logout
Login
To authenticate (so we know who you are) and authorize (so we know what you're allowed to do) the user, they will need to perform a Login
.
- Go
- NodeJS
- Java
- Python
const userID = "userID@organization.com"
const userPasswd = "userPassword"
const orgID = "organizationID"
// client is the previous initialized client
token, err := api.Login(client, userID, userPasswd, orgID)
if err != nil {
log.Printf("failed to Login: %s", err)
os.Exit(1)
}
The returned token is automatically stored in the passed in client
object. This token is automatically used for subsequent API calls that requires authentication.
Logout
Once you finish your session, make sure to Logout
. This will retire the key from use.
- Go
- NodeJS
- Java
- Python
// client is the client object used for login
err := api.Logout(client)
if err != nil {
log.Printf("failed to Logout: %s", err)
os.Exit(1)
}
Calling logout
automatically erases the authentication token stored in the StrongDoc client. It also recreates a record on the server that prevents access with the previous token.
Link to API Github Repository: https://github.com/overnest/strongdoc-go-sdk