CredentialsHTTPDigest
public class CredentialsHTTPDigest : CredentialsPluginProtocol
Authenticate requests using HTTP Digest authentication. See RFC 7616 for details.
-
The name of the plugin.
Declaration
Swift
public var name: String { get } -
An indication as to whether the plugin is redirecting or not.
Declaration
Swift
public var redirecting: Bool { get } -
User profile cache.
Declaration
Swift
public var usersCache: NSCache<NSString, BaseCacheElement>? -
The authentication realm attribute.
Declaration
Swift
public var realm: String -
The opaque value (optional).
Declaration
Swift
public var opaque: String? -
Initialize a
CredentialsHTTPDigestinstance.Declaration
Swift
public init(userProfileLoader: @escaping UserProfileLoader, opaque: String? = nil, realm: String? = nil)Parameters
userProfileLoaderThe callback for loading the user profile.
realmThe realm attribute.
realmThe realm attribute.
-
Authenticate incoming request using HTTP Digest authentication.
Declaration
Swift
public func authenticate (request: RouterRequest, response: RouterResponse, options: [String:Any], onSuccess: @escaping (UserProfile) -> Void, onFailure: @escaping (HTTPStatusCode?, [String:String]?) -> Void, onPass: @escaping (HTTPStatusCode?, [String:String]?) -> Void, inProgress: @escaping () -> Void)Parameters
requestThe
RouterRequestobject used to get information about the request.responseThe
RouterResponseobject used to respond to the request.optionsThe dictionary of plugin specific options.
onSuccessThe closure to invoke in the case of successful authentication.
onFailureThe closure to invoke in the case of an authentication failure.
onPassThe closure to invoke when the plugin doesn’t recognize the authentication data in the request.
inProgressThe closure to invoke to cause a redirect to the login page in the case of redirecting authentication.
View on GitHub
CredentialsHTTPDigest Class Reference