GET,POST | /auth/{provider} | ||
---|---|---|---|
GET,POST | /auth |
import java.math.*
import java.util.*
import net.servicestack.client.*
/**
* Sign In
*/
@Api(Description="Sign In")
@DataContract
open class Authenticate : IPost, IMeta
{
/**
* AuthProvider, e.g. credentials
*/
@DataMember(Order=1)
var provider:String? = null
@DataMember(Order=2)
var UserName:String? = null
@DataMember(Order=3)
var Password:String? = null
@DataMember(Order=4)
var RememberMe:Boolean? = null
@DataMember(Order=5)
var AccessToken:String? = null
@DataMember(Order=6)
var AccessTokenSecret:String? = null
@DataMember(Order=7)
var ReturnUrl:String? = null
@DataMember(Order=8)
var ErrorView:String? = null
@DataMember(Order=9)
var Meta:HashMap<String,String> = HashMap<String,String>()
}
@DataContract
open class AuthenticateResponse : IMeta, IHasSessionId, IHasBearerToken
{
@DataMember(Order=1)
var UserId:String? = null
@DataMember(Order=2)
var SessionId:String? = null
@DataMember(Order=3)
var UserName:String? = null
@DataMember(Order=4)
var DisplayName:String? = null
@DataMember(Order=5)
var ReferrerUrl:String? = null
@DataMember(Order=6)
var BearerToken:String? = null
@DataMember(Order=7)
var RefreshToken:String? = null
@DataMember(Order=8)
var RefreshTokenExpiry:Date? = null
@DataMember(Order=9)
var ProfileUrl:String? = null
@DataMember(Order=10)
var Roles:ArrayList<String> = ArrayList<String>()
@DataMember(Order=11)
var Permissions:ArrayList<String> = ArrayList<String>()
@DataMember(Order=12)
var ResponseStatus:ResponseStatus? = null
@DataMember(Order=13)
var Meta:HashMap<String,String> = HashMap<String,String>()
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /auth/{provider} HTTP/1.1
Host: initiation-test.sirva.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"provider":"String","UserName":"String","Password":"String","RememberMe":false,"AccessToken":"String","AccessTokenSecret":"String","ReturnUrl":"String","ErrorView":"String","Meta":{"String":"String"}}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"UserId":"String","SessionId":"String","UserName":"String","DisplayName":"String","ReferrerUrl":"String","BearerToken":"String","RefreshToken":"String","RefreshTokenExpiry":"\/Date(-62135596800000-0000)\/","ProfileUrl":"String","Roles":["String"],"Permissions":["String"],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Meta":{"String":"String"}}