POST | /v1/login | Process GAS Authentication |
---|
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Mercedes.Auth.API.ServiceModel
Namespace Global
Namespace Mercedes.Auth.API.ServiceModel
Public Partial Class LoginRequest
Implements IPost
'''<Summary>
'''GAS AuthCode
'''</Summary>
<ApiMember(Description:="GAS AuthCode")>
Public Overridable Property AuthCode As String
'''<Summary>
'''GAS ErrorCode
'''</Summary>
<ApiMember(Description:="GAS ErrorCode")>
Public Overridable Property ErrorCode As String
'''<Summary>
'''Client Id
'''</Summary>
<ApiMember(Description:="Client Id")>
Public Overridable Property ClientId As String
'''<Summary>
'''Secret
'''</Summary>
<ApiMember(Description:="Secret")>
Public Overridable Property Secret As String
'''<Summary>
'''Callback Url
'''</Summary>
<ApiMember(Description:="Callback Url")>
Public Overridable Property CallbackUrl As String
'''<Summary>
'''Redirect Url
'''</Summary>
<ApiMember(Description:="Redirect Url")>
Public Overridable Property RedirectUrl As String
End Class
Public Partial Class LoginResponse
Public Overridable Property RedirectUrl As String
Public Overridable Property IsAuthenticated As Boolean
Public Overridable Property UserToken As String
Public Overridable Property UserId As String
Public Overridable Property UserRoleId As List(Of Integer)
Public Overridable Property DefaultRetailer As String
Public Overridable Property LoginStatus As LoginStatus
Public Overridable Property UserRoleRedirect As String
Public Overridable Property DefaultVehicleType As String
Public Overridable Property EntitlementGroup As List(Of String)
End Class
Public Enum LoginStatus
Authenticated
NotAuthenticated
[Error]
End Enum
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/login HTTP/1.1
Host: prod-api-auth-mb-dhc.rapp-customers.co.uk
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"AuthCode":"String","ErrorCode":"String","ClientId":"String","Secret":"String","CallbackUrl":"String","RedirectUrl":"String"}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"RedirectUrl":"String","IsAuthenticated":false,"UserToken":"String","UserId":"String","UserRoleId":[0],"DefaultRetailer":"String","LoginStatus":"Authenticated","UserRoleRedirect":"String","DefaultVehicleType":"String","EntitlementGroup":["String"]}