GET | /nemidvalidatelogin |
---|
import Foundation
import ServiceStack
public class ValidateNemIdRequestModel : Codable
{
required public init(){}
}
public class NemIDFlowResult : FlowResult
{
public var authenticationInfo:AuthenticationInfo?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case authenticationInfo
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
authenticationInfo = try container.decodeIfPresent(AuthenticationInfo.self, forKey: .authenticationInfo)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if authenticationInfo != nil { try container.encode(authenticationInfo, forKey: .authenticationInfo) }
}
}
public class FlowResult : FlowMessage
{
public var clientFlow:ClientFlow?
public var status:FlowStatus?
public var isSuccess:Bool?
public var message:String?
public var userMessage:String?
public var flowErrorCode:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case clientFlow
case status
case isSuccess
case message
case userMessage
case flowErrorCode
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
clientFlow = try container.decodeIfPresent(ClientFlow.self, forKey: .clientFlow)
status = try container.decodeIfPresent(FlowStatus.self, forKey: .status)
isSuccess = try container.decodeIfPresent(Bool.self, forKey: .isSuccess)
message = try container.decodeIfPresent(String.self, forKey: .message)
userMessage = try container.decodeIfPresent(String.self, forKey: .userMessage)
flowErrorCode = try container.decodeIfPresent(String.self, forKey: .flowErrorCode)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if clientFlow != nil { try container.encode(clientFlow, forKey: .clientFlow) }
if status != nil { try container.encode(status, forKey: .status) }
if isSuccess != nil { try container.encode(isSuccess, forKey: .isSuccess) }
if message != nil { try container.encode(message, forKey: .message) }
if userMessage != nil { try container.encode(userMessage, forKey: .userMessage) }
if flowErrorCode != nil { try container.encode(flowErrorCode, forKey: .flowErrorCode) }
}
}
public class FlowMessage : Body
{
public var timestamp:String?
public var transactionIdentifier:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case timestamp
case transactionIdentifier
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
timestamp = try container.decodeIfPresent(String.self, forKey: .timestamp)
transactionIdentifier = try container.decodeIfPresent(String.self, forKey: .transactionIdentifier)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if timestamp != nil { try container.encode(timestamp, forKey: .timestamp) }
if transactionIdentifier != nil { try container.encode(transactionIdentifier, forKey: .transactionIdentifier) }
}
}
public class Body : Codable
{
required public init(){}
}
public enum ClientFlow : String, Codable
{
case NemID
case NemIDSignature
case NemIDKeyFile
case NemIDKeyFileSignature
case NL3Signature
case Invalid
case LoadTest
}
public enum FlowStatus : String, Codable
{
case Ok
case UserCancel
case ClientFlowError
case FlowError
case ValidationError
}
public class AuthenticationInfo : Codable
{
public var pid:String?
public var dn:String?
public var commonName:String?
public var rid:String?
public var cpr:String?
public var cvr:String?
public var company:String?
public var email:String?
public var signedXml:String?
public var issuerDn:String?
public var isYouthCert:Bool?
public var certificateType:CertificateType?
public var subjectSerialNumber:String?
public var signProperties:IList<SignProperty>?
public var rememberUserIdToken:String?
public var logonType:LogonType?
public var certificateSerialNumber:String?
public var clientCertificate:[UInt8] = []
public var authorizedToRepresent:String?
required public init(){}
}
public enum CertificateType : String, Codable
{
case Poces
case Moces
case Voces
case Foces
}
public class SignProperty : Codable
{
public var name:String?
public var value:String?
required public init(){}
}
public enum LogonType : String, Codable
{
case Otp
case KeyFile
case Unknown
}
Swift 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"}