GET | /nemidvalidatelogin |
---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ValidateNemIdRequestModel:
pass
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Body:
pass
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FlowMessage(Body):
timestamp: Optional[str] = None
transaction_identifier: Optional[str] = None
class ClientFlow(str, Enum):
NEM_I_D = 'NemID'
NEM_I_D_SIGNATURE = 'NemIDSignature'
NEM_I_D_KEY_FILE = 'NemIDKeyFile'
NEM_I_D_KEY_FILE_SIGNATURE = 'NemIDKeyFileSignature'
N_L3_SIGNATURE = 'NL3Signature'
INVALID = 'Invalid'
LOAD_TEST = 'LoadTest'
class FlowStatus(str, Enum):
OK = 'Ok'
USER_CANCEL = 'UserCancel'
CLIENT_FLOW_ERROR = 'ClientFlowError'
FLOW_ERROR = 'FlowError'
VALIDATION_ERROR = 'ValidationError'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FlowResult(FlowMessage):
client_flow: Optional[ClientFlow] = None
status: Optional[FlowStatus] = None
is_success: Optional[bool] = None
message: Optional[str] = None
user_message: Optional[str] = None
flow_error_code: Optional[str] = None
class CertificateType(str, Enum):
POCES = 'Poces'
MOCES = 'Moces'
VOCES = 'Voces'
FOCES = 'Foces'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SignProperty:
name: Optional[str] = None
value: Optional[str] = None
class LogonType(str, Enum):
OTP = 'Otp'
KEY_FILE = 'KeyFile'
UNKNOWN = 'Unknown'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AuthenticationInfo:
pid: Optional[str] = None
dn: Optional[str] = None
common_name: Optional[str] = None
rid: Optional[str] = None
cpr: Optional[str] = None
cvr: Optional[str] = None
company: Optional[str] = None
email: Optional[str] = None
signed_xml: Optional[str] = None
issuer_dn: Optional[str] = None
is_youth_cert: Optional[bool] = None
certificate_type: Optional[CertificateType] = None
subject_serial_number: Optional[str] = None
sign_properties: Optional[IList[SignProperty]] = None
remember_user_id_token: Optional[str] = None
logon_type: Optional[LogonType] = None
certificate_serial_number: Optional[str] = None
client_certificate: Optional[bytes] = None
authorized_to_represent: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class NemIDFlowResult(FlowResult):
authentication_info: Optional[AuthenticationInfo] = None
Python ValidateNemIdRequestModel DTOs
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.
GET /nemidvalidatelogin HTTP/1.1 Host: hcbtas-q-albamfs-api.azurewebsites.net Accept: application/json
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"authenticationInfo":{"pid":"String","dn":"String","commonName":"String","rid":"String","cpr":"String","cvr":"String","company":"String","email":"String","signedXml":"String","issuerDn":"String","isYouthCert":false,"certificateType":"Poces","subjectSerialNumber":"String","rememberUserIdToken":"String","logonType":"Otp","certificateSerialNumber":"String","clientCertificate":"AA==","authorizedToRepresent":"String"},"clientFlow":"NemID","status":"Ok","isSuccess":true,"message":"String","userMessage":"String","flowErrorCode":"String","timestamp":"String","transactionIdentifier":"String"}