tvpl.api

<back to all web services

AuthenticateWithKeycloak

The following routes are available for this service:
POST/auth/keycloak
import 'package:servicestack/servicestack.dart';

class AuthenticateWithKeycloakResponse implements IConvertible
{
    String? bearerToken;
    String? refreshToken;
    String? sessionId;
    String? userName;
    String? displayName;
    ResponseStatus? responseStatus;

    AuthenticateWithKeycloakResponse({this.bearerToken,this.refreshToken,this.sessionId,this.userName,this.displayName,this.responseStatus});
    AuthenticateWithKeycloakResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        bearerToken = json['bearerToken'];
        refreshToken = json['refreshToken'];
        sessionId = json['sessionId'];
        userName = json['userName'];
        displayName = json['displayName'];
        responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'bearerToken': bearerToken,
        'refreshToken': refreshToken,
        'sessionId': sessionId,
        'userName': userName,
        'displayName': displayName,
        'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "AuthenticateWithKeycloakResponse";
    TypeContext? context = _ctx;
}

class AuthenticateWithKeycloak implements IConvertible
{
    String? accessToken;

    AuthenticateWithKeycloak({this.accessToken});
    AuthenticateWithKeycloak.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        accessToken = json['accessToken'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'accessToken': accessToken
    };

    getTypeName() => "AuthenticateWithKeycloak";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
    'AuthenticateWithKeycloakResponse': TypeInfo(TypeOf.Class, create:() => AuthenticateWithKeycloakResponse()),
    'AuthenticateWithKeycloak': TypeInfo(TypeOf.Class, create:() => AuthenticateWithKeycloak()),
});

Dart AuthenticateWithKeycloak DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /auth/keycloak HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	accessToken: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	bearerToken: String,
	refreshToken: String,
	sessionId: String,
	userName: String,
	displayName: String,
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}