         if let accessToken = accessToken {
             if accessToken.expiresAt != nil && accessToken.expiresAt < NSDate() {
                 if let refreshToken = accessToken.refreshToken {
-                    authorize(.Refresh(refreshToken: refreshToken)) { result in
+                    authorize(.Refresh(refreshToken)) { result in
                         completion(result.map { accessToken in
                             return self.requestByAddingAuthorizationHeaderToRequest(request, accessToken: accessToken)
                         })

public let HeimdallErrorNotAuthorized = 3

private enum AuthorizationGrant {
    case ResourceOwnerPasswordCredentials(username: String, password: String)
    case Refresh(refreshToken: String)

    private var parameters: [String: String] {
        switch self {

    }

    public func authorize(username: String, password: String, completion: Result<Void, NSError> -> ()) {
        authorize(.ResourceOwnerPasswordCredentials(username, password)) { result in
            completion(result.map { _ in return })
        }
    }
