OPTIONS,GET,POST,DELETE | /auth | ||
---|---|---|---|
OPTIONS,GET,POST,DELETE | /auth/{provider} |
import 'package:servicestack/servicestack.dart';
// @DataContract
class AuthenticateResponse implements IMeta, IHasSessionId, IHasBearerToken, IConvertible
{
// @DataMember(Order=1)
String? UserId;
// @DataMember(Order=2)
String? SessionId;
// @DataMember(Order=3)
String? UserName;
// @DataMember(Order=4)
String? DisplayName;
// @DataMember(Order=5)
String? ReferrerUrl;
// @DataMember(Order=6)
String? BearerToken;
// @DataMember(Order=7)
String? RefreshToken;
// @DataMember(Order=8)
String? ProfileUrl;
// @DataMember(Order=9)
List<String>? Roles;
// @DataMember(Order=10)
List<String>? Permissions;
// @DataMember(Order=11)
ResponseStatus? ResponseStatus;
// @DataMember(Order=12)
Map<String,String?>? Meta;
AuthenticateResponse({this.UserId,this.SessionId,this.UserName,this.DisplayName,this.ReferrerUrl,this.BearerToken,this.RefreshToken,this.ProfileUrl,this.Roles,this.Permissions,this.ResponseStatus,this.Meta});
AuthenticateResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
UserId = json['UserId'];
SessionId = json['SessionId'];
UserName = json['UserName'];
DisplayName = json['DisplayName'];
ReferrerUrl = json['ReferrerUrl'];
BearerToken = json['BearerToken'];
RefreshToken = json['RefreshToken'];
ProfileUrl = json['ProfileUrl'];
Roles = JsonConverters.fromJson(json['Roles'],'List<String>',context!);
Permissions = JsonConverters.fromJson(json['Permissions'],'List<String>',context!);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Meta = JsonConverters.toStringMap(json['Meta']);
return this;
}
Map<String, dynamic> toJson() => {
'UserId': UserId,
'SessionId': SessionId,
'UserName': UserName,
'DisplayName': DisplayName,
'ReferrerUrl': ReferrerUrl,
'BearerToken': BearerToken,
'RefreshToken': RefreshToken,
'ProfileUrl': ProfileUrl,
'Roles': JsonConverters.toJson(Roles,'List<String>',context!),
'Permissions': JsonConverters.toJson(Permissions,'List<String>',context!),
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Meta': Meta
};
getTypeName() => "AuthenticateResponse";
TypeContext? context = _ctx;
}
/**
* Sign In
*/
// @Api(Description="Sign In")
// @DataContract
class Authenticate implements IPost, IMeta, IConvertible
{
/**
* AuthProvider, e.g. credentials
*/
// @DataMember(Order=1)
String? provider;
// @DataMember(Order=2)
String? State;
// @DataMember(Order=3)
String? oauth_token;
// @DataMember(Order=4)
String? oauth_verifier;
// @DataMember(Order=5)
String? UserName;
// @DataMember(Order=6)
String? Password;
// @DataMember(Order=7)
bool? RememberMe;
// @DataMember(Order=9)
String? ErrorView;
// @DataMember(Order=10)
String? nonce;
// @DataMember(Order=11)
String? uri;
// @DataMember(Order=12)
String? response;
// @DataMember(Order=13)
String? qop;
// @DataMember(Order=14)
String? nc;
// @DataMember(Order=15)
String? cnonce;
// @DataMember(Order=17)
String? AccessToken;
// @DataMember(Order=18)
String? AccessTokenSecret;
// @DataMember(Order=19)
String? scope;
// @DataMember(Order=20)
Map<String,String?>? Meta;
Authenticate({this.provider,this.State,this.oauth_token,this.oauth_verifier,this.UserName,this.Password,this.RememberMe,this.ErrorView,this.nonce,this.uri,this.response,this.qop,this.nc,this.cnonce,this.AccessToken,this.AccessTokenSecret,this.scope,this.Meta});
Authenticate.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
provider = json['provider'];
State = json['State'];
oauth_token = json['oauth_token'];
oauth_verifier = json['oauth_verifier'];
UserName = json['UserName'];
Password = json['Password'];
RememberMe = json['RememberMe'];
ErrorView = json['ErrorView'];
nonce = json['nonce'];
uri = json['uri'];
response = json['response'];
qop = json['qop'];
nc = json['nc'];
cnonce = json['cnonce'];
AccessToken = json['AccessToken'];
AccessTokenSecret = json['AccessTokenSecret'];
scope = json['scope'];
Meta = JsonConverters.toStringMap(json['Meta']);
return this;
}
Map<String, dynamic> toJson() => {
'provider': provider,
'State': State,
'oauth_token': oauth_token,
'oauth_verifier': oauth_verifier,
'UserName': UserName,
'Password': Password,
'RememberMe': RememberMe,
'ErrorView': ErrorView,
'nonce': nonce,
'uri': uri,
'response': response,
'qop': qop,
'nc': nc,
'cnonce': cnonce,
'AccessToken': AccessToken,
'AccessTokenSecret': AccessTokenSecret,
'scope': scope,
'Meta': Meta
};
getTypeName() => "Authenticate";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'cip_reporting_dev.chargeitpro.com', types: <String, TypeInfo> {
});
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-dev.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"}}