-
Notifications
You must be signed in to change notification settings - Fork 28
Description
In order to make "rememberDevice" work, user needs to send deviceToken in /authn API. Currently, OktaAPI.primaryAuthentication() supports "deviceToken" parameter, however, public function OktaAuthSdk.authenticate() does not. Should add it to enable the feature.
We plan to release our first version of mobile app for supporting Okta in 3 weeks, it would be great to have the fix by 9/23. Thanks.
Sample code:
class OktaAuthSdk:
public class func authenticate(with url: URL,
username: String,
password: String?,
deviceToken: String? = nil,
onStatusChange: @escaping (_ newStatus: OktaAuthStatus) -> Void,
onError: @escaping (_ error: OktaError) -> Void) {
let unauthenticatedStatus = OktaAuthStatusUnauthenticated(oktaDomain: url)
unauthenticatedStatus.authenticate(username: username,
password: password ?? "",
deviceToken: deviceToken,
onStatusChange:onStatusChange,
onError:onError)
}
class OktaAuthStatusUnauthenticated:
open func authenticate(username: String,
password: String,
deviceToken: String?,
onStatusChange: @escaping (_ newStatus: OktaAuthStatus) -> Void,
onError: @escaping (_ error: OktaError) -> Void) {
restApi.primaryAuthentication(username: username,
password: password,
deviceToken: deviceToken,
deviceFingerprint: nil)
{ result in
self.handleServerResponse(result,
onStatusChanged: onStatusChange,
onError: onError)
}
}