OPTIONS,GET,POST,DELETE | /auth | ||
---|---|---|---|
OPTIONS,GET,POST,DELETE | /auth/{provider} |
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 State:String? = null
@DataMember(Order=3)
var oauth_token:String? = null
@DataMember(Order=4)
var oauth_verifier:String? = null
@DataMember(Order=5)
var UserName:String? = null
@DataMember(Order=6)
var Password:String? = null
@DataMember(Order=7)
var RememberMe:Boolean? = null
@DataMember(Order=9)
var ErrorView:String? = null
@DataMember(Order=10)
var nonce:String? = null
@DataMember(Order=11)
var uri:String? = null
@DataMember(Order=12)
var response:String? = null
@DataMember(Order=13)
var qop:String? = null
@DataMember(Order=14)
var nc:String? = null
@DataMember(Order=15)
var cnonce:String? = null
@DataMember(Order=17)
var AccessToken:String? = null
@DataMember(Order=18)
var AccessTokenSecret:String? = null
@DataMember(Order=19)
var scope:String? = null
@DataMember(Order=20)
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 ProfileUrl:String? = null
@DataMember(Order=9)
var Roles:ArrayList<String> = ArrayList<String>()
@DataMember(Order=10)
var Permissions:ArrayList<String> = ArrayList<String>()
@DataMember(Order=11)
var ResponseStatus:ResponseStatus? = null
@DataMember(Order=12)
var Meta:HashMap<String,String> = HashMap<String,String>()
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /auth HTTP/1.1
Host: cip-reporting-staging.chargeitpro.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"provider":"String","State":"String","oauth_token":"String","oauth_verifier":"String","UserName":"String","Password":"String","RememberMe":false,"ErrorView":"String","nonce":"String","uri":"String","response":"String","qop":"String","nc":"String","cnonce":"String","AccessToken":"String","AccessTokenSecret":"String","scope":"String","Meta":{"String":"String"}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"UserId":"String","SessionId":"String","UserName":"String","DisplayName":"String","ReferrerUrl":"String","BearerToken":"String","RefreshToken":"String","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"}}