OAuth2PasswordAuthenticationParameters
public struct OAuth2PasswordAuthenticationParameters
extension OAuth2PasswordAuthenticationParameters: DiscoveryServiceConfigurable
Undocumented
-
This URL loads the login page and gets the additional parameters as GET parameters.
Declaration
Swift
public let authorizationEndpointURL: URL
-
This URL has the functionality to exchange OAuth 2.0 code grant for a OAuth 2.0 token.
Declaration
Swift
public let tokenEndpointURL: URL
-
This is the URL which will be loaded at the end of the web view login process. The OAuth 2.0 code grant will be appended to the end of this URL as a GET parameter.
Declaration
Swift
public let redirectURL: URL
-
The identifier of the client that is configured on the OAuth2 server.
Declaration
Swift
public let clientID: String
-
The passcode obtained from a successful qr code scan.
Declaration
Swift
public let passcode: String
-
Authentication parameters for the Password Grant.
Declaration
Swift
public init(authorizationEndpointURL: URL, clientID: String, redirectURL: URL, tokenEndpointURL: URL, passcode: String)
Parameters
authorizationEndpointURL
This URL loads the login page and gets the additional parameters as GET parameters.
clientID
The identifier of the client that is configured on the OAuth2 server.
redirectURL
This is the URL which will be loaded at the end of the web view login process. The OAuth 2.0 code grant will be appended to the end of this URL as a GET parameter.
tokenEndpointURL
This URL has the functionality to exchange OAuth 2.0 code grant for a OAuth 2.0 token.
passcode
The passcode obtained from a successful qr code scan.
-
Undocumented
Declaration
Swift
public var authenticationParameters: OAuth2AuthenticationParameters { get }
-
Undocumented
Declaration
Swift
public enum DiscoveryServiceConstants
-
Instantiates the OAuth2PasswordAuthenticationParameters from the Discovery Service configuration object. Example Discovery Service configuration structure contaning an OAuth 2.0 configuration:
{ "auth": [{ "type": "oauth2", "config": { "oauth2.tokenEndpoint": "https://oauthasservices-###.hana.ondemand.com/oauth2/api/v1/token", "oauth2.authorizationEndpoint": "https://oauthasservices-###.hana.ondemand.com/oauth2/api/v1/authorize", "oauth2.endUserUI": "https://oauthasservices-###.hana.ondemand.com/oauth2", "oauth2.clients": [{ "clientID": "123532-426436-234352354-2352-235-3252", "redirectURL": "scheme://redirect.url", "grantType": "password", "passcode": "0123456789abcdefghijklmnopqrstuv" }] } }], "host": "mobilepreview-aaf7eb1c4.hana.ondemand.com", "port": 443, "protocol": "https" }
Will use the corresponding auth-type if there are multiple auths. Will use the first client and ignore the rest.
Throws
ConfigurationError if a key is missing or the object has invalid structureDeclaration
Swift
public init(discoveryServiceConfig config: Any) throws
-
Instantiates the OAuth2PasswordAuthenticationParameters from the corresponding sub-configuration of the Discovery Service configuration object. Example OAuth 2.0 sub-configuration structure in a Discovery Service configuration object:
{ "oauth2.tokenEndpoint": "https://oauthasservices-###.hana.ondemand.com/oauth2/api/v1/token", "oauth2.authorizationEndpoint": "https://oauthasservices-###.hana.ondemand.com/oauth2/api/v1/authorize", "oauth2.endUserUI": "https://oauthasservices-###.hana.ondemand.com/oauth2", "oauth2.clients": [{ "clientID": "123532-426436-234352354-2352-235-3252", "redirectURL": "scheme://redirect.url", "grantType": "password", "passcode": "0123456789abcdefghijklmnopqrstuv" }] }
Will use the first client and ignore the rest.
Throws
ConfigurationError if a key is missing or the object has invalid structureDeclaration
Swift
public init(config: Any) throws