'\" t
.\" Title: authentication
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 06/22/2016
.\" Manual: RAD Module Definitions
.\" Source: SunOS 5.11
.\" Language: English
.\"
.TH "AUTHENTICATION" "3rad" "06/22/2016" "SunOS 5.11" "RAD Module Definitions"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
authentication
.SH "SYNOPSIS"
.SS "interface Session"
.sp
.nf
string\ \&user\ \&;
.
string[]\ \&roles\ \&;
.
string\ \&token\ \&;
.fi
.sp
.nf
create(string\ \&username,
.
\ \&\ \&\ \&\ \&\ \&\ \&\ \&secret\ \&password,
.
\ \&\ \&\ \&\ \&\ \&\ \&\ \&string\ \&scheme,
.
\ \&\ \&\ \&\ \&\ \&\ \&\ \&boolean\ \&preserve,
.
\ \&\ \&\ \&\ \&\ \&\ \&\ \&long\ \&timeout);
.fi
.sp
.nf
delete();
.fi
.SH "DESCRIPTION"
.PP
\fBapi com\&.oracle\&.solaris\&.rad\&.authentication\fR
.PP
This API provides functions for generating and redeeming security tokens for RAD\'s token\-based Authentication\&.
.SH "INTERFACES"
.SS "interface Session"
.PP
Session interface\&. Represents a session within RAD\&. Clients should interact with this interface to: \- authenticate and obtain access to RAD \- retrieve, redeem and revoke UUID authentication tokens \- obtain information about existing sessions \- delete sessions \- obtain session specific data, user, roles\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBSession Properties\fR
.RS 4
.PP
\fBstring\fR\ \&\fBuser\fR
(\fIread\-only\fR, \fInullable\fR) \(em gets the username of the connected user
.PP
\fBstring[]\fR\ \&\fBroles\fR
(\fIread\-only\fR) \(em gets the list of roles available to the connected user
.PP
\fBstring\fR\ \&\fBtoken\fR
(\fIread\-write\fR, \fInullable\fR) \(em Read/Write the session\'s token\&.
.RE
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBinterface Methods\fR
.RS 4
.PP
\fBcreate\fR(\fBstring\fR\ \&\fIusername\fR, \fBsecret\fR\ \&\fIpassword\fR, \fBstring\fR\ \&\fIscheme\fR, \fBboolean\fR\ \&\fIpreserve\fR, \fBlong\fR\ \&\fItimeout\fR)
.RS 4
.PP
Create a new Session instance\&. If authentication data cannot be validated by the server an error is raised\&. For HTTP clients, a secure token is returned in the HTTP cookie\&.
.sp
.if n \{\
.RS 4
.\}
.nf
# Authenticate and receive a security token
curl \-v \-X POST \-c cookiejar\&.txt \-b cookiejar\&.txt
\-\-header \'Content\-Type: application/json\'
\-\-data \'{"username": \&.\&.\&., "password": \&.\&.\&., \&.\&.\&.}\'
localhost/api/com\&.oracle\&.solaris\&.rad\&.authentication/1\&.0/Session
{
"payload": {
"href": "/api/com\&.oracle\&.solaris\&.rad\&.authentication/1\&.0/Session/_rad_reference/"
},
"status": "success"
}
# Subsequent requests will use the token as stored in HTTP cookie
curl \-v \-X GET \-c cookiejar\&.txt \-b cookiejar\&.txt
localhost/api/com\&.oracle\&.solaris\&.rad\&.authentication/1\&.0/Session/_rad_reference//user
.fi
.if n \{\
.RE
.\}
.PP
\fBArguments:\fR
.PP
\fIusername\fR
.PP
\fIpassword\fR
.PP
\fIscheme\fR
\(em Sets the authentication scheme\&. Currently only \'pam\' supported\&.
.PP
\fIpreserve\fR
.PP
\fItimeout\fR
\(em If timeout is specified as \-1, the default session timeout for this REST interfaces is 60 minutes\&.
.PP
\fBError:\fR
.PP
\fI(no type)\fR
.RE
.PP
\fBdelete\fR()
.RS 4
.PP
Delete and disconnect current session\&.
.sp
.if n \{\
.RS 4
.\}
.nf
curl \-v \-X DELETE localhost/api/com\&.oracle\&.solaris\&.rad\&.authentication/1\&.0/Session/_rad_reference/
.fi
.if n \{\
.RE
.\}
.PP
\fBError:\fR
.PP
\fI(no type)\fR
.RE
.RE
.PP
\fBVersion:\fR
(1\&.0)