INTERNAL-Authorization

<back to all web services

AuthorizeUser

Requires Authentication
The following routes are available for this service:
GET,POST/authorizeuser/{Service}/{Profile}
import 'package:servicestack/servicestack.dart';

class Setting implements IConvertible
{
    String? name;
    String? stringValue;
    bool? booleanValue;
    String? dataType;

    Setting({this.name,this.stringValue,this.booleanValue,this.dataType});
    Setting.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        name = json['name'];
        stringValue = json['stringValue'];
        booleanValue = json['booleanValue'];
        dataType = json['dataType'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'name': name,
        'stringValue': stringValue,
        'booleanValue': booleanValue,
        'dataType': dataType
    };

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

class AuthorizeBaseResponse implements IConvertible
{
    bool? isAuthorized;
    List<Setting>? settings;
    int? suggestedStatusCode;
    String? suggestedResponseMessage;
    String? reason;
    String? customerId;

    AuthorizeBaseResponse({this.isAuthorized,this.settings,this.suggestedStatusCode,this.suggestedResponseMessage,this.reason,this.customerId});
    AuthorizeBaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        isAuthorized = json['isAuthorized'];
        settings = JsonConverters.fromJson(json['settings'],'List<Setting>',context!);
        suggestedStatusCode = json['suggestedStatusCode'];
        suggestedResponseMessage = json['suggestedResponseMessage'];
        reason = json['reason'];
        customerId = json['customerId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'isAuthorized': isAuthorized,
        'settings': JsonConverters.toJson(settings,'List<Setting>',context!),
        'suggestedStatusCode': suggestedStatusCode,
        'suggestedResponseMessage': suggestedResponseMessage,
        'reason': reason,
        'customerId': customerId
    };

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

class AuthorizeUserResponse extends AuthorizeBaseResponse implements IAuthorizeUserResponse, IConvertible
{
    String? userObjectId;
    String? userTenant;
    String? userTenantId;

    AuthorizeUserResponse({this.userObjectId,this.userTenant,this.userTenantId});
    AuthorizeUserResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        userObjectId = json['userObjectId'];
        userTenant = json['userTenant'];
        userTenantId = json['userTenantId'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'userObjectId': userObjectId,
        'userTenant': userTenant,
        'userTenantId': userTenantId
    });

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

class AuthorizeUser implements IAuthorizeUser, IConvertible
{
    // @ApiMember(IsRequired=true)
    String? bearerToken;

    // @ApiMember(IsRequired=true, ParameterType="path")
    String? profile;

    // @ApiMember(IsRequired=true, ParameterType="path")
    String? service;

    // @ApiMember(Name="X-WAAPI-CONTEXT", ParameterType="header")
    String? customerContext;

    AuthorizeUser({this.bearerToken,this.profile,this.service,this.customerContext});
    AuthorizeUser.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        bearerToken = json['bearerToken'];
        profile = json['profile'];
        service = json['service'];
        customerContext = json['customerContext'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'bearerToken': bearerToken,
        'profile': profile,
        'service': service,
        'customerContext': customerContext
    };

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

TypeContext _ctx = TypeContext(library: 'nkapi_sgepz3_auth_r1.azurewebsites.net', types: <String, TypeInfo> {
    'Setting': TypeInfo(TypeOf.Class, create:() => Setting()),
    'AuthorizeBaseResponse': TypeInfo(TypeOf.Class, create:() => AuthorizeBaseResponse()),
    'List<Setting>': TypeInfo(TypeOf.Class, create:() => <Setting>[]),
    'AuthorizeUserResponse': TypeInfo(TypeOf.Class, create:() => AuthorizeUserResponse()),
    'AuthorizeUser': TypeInfo(TypeOf.Class, create:() => AuthorizeUser()),
});

Dart AuthorizeUser DTOs

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

HTTP + XML

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

POST /authorizeuser/{Service}/{Profile} HTTP/1.1 
Host: nkapi-sgepz3-auth-r1.azurewebsites.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<AuthorizeUser xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Norkart.Api.Authorization.ServiceModel">
  <BearerToken>String</BearerToken>
  <CustomerContext>String</CustomerContext>
  <Profile>String</Profile>
  <Service>String</Service>
</AuthorizeUser>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AuthorizeUserResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Norkart.Api.Authorization.ServiceModel">
  <CustomerId i:nil="true" />
  <IsAuthorized>false</IsAuthorized>
  <Reason>String</Reason>
  <Settings>
    <Setting>
      <BooleanValue>false</BooleanValue>
      <DataType>String</DataType>
      <Name>String</Name>
      <StringValue>String</StringValue>
    </Setting>
  </Settings>
  <SuggestedResponseMessage>String</SuggestedResponseMessage>
  <SuggestedStatusCode>0</SuggestedStatusCode>
  <UserObjectId i:nil="true" />
  <UserTenant>String</UserTenant>
  <UserTenantId>String</UserTenantId>
</AuthorizeUserResponse>