Class SFAuthenticationSession

  • All Implemented Interfaces:
    NSObject

    public class SFAuthenticationSession
    extends NSObject
    SFAuthenticationSession An SFAuthenticationSession object can be used to authenticate a user with a web service, even if the web service is run by a third party. SFAuthenticationSession puts the user in control of whether they want to use their existing logged-in session from Safari. The app provides a URL that points to the authentication webpage. The page will be loaded in a secure view controller. From the webpage, the user can authenticate herself and grant access to the app. On completion, the service will send a callback URL with an authentication token, and this URL will be passed to the app by SFAuthenticationCompletionHandler. The callback URL usually has a custom URL scheme. For the app to receive the callback URL, it needs to either register the custom URL scheme in its Info.plist, or set the scheme to callbackURLScheme argument in the initializer. If the user has already logged into the web service in Safari or other apps via SFAuthenticationSession, it is possible to share the existing login information. An alert will be presented to get the user's consent for sharing their existing login information. If the user cancels the alert, the session will be canceled, and the completion handler will be called with the error code SFAuthenticationErrorCanceledLogin. If the user taps Cancel when showing the login webpage for the web service, the session will be canceled, and the completion handler will be called with the error code SFAuthenticationErrorCanceledLogin. The app can cancel the session by calling -[SFAuthenticationSession cancel]. This will also dismiss the view controller that is showing the web service's login page.
    • Constructor Detail

      • SFAuthenticationSession

        protected SFAuthenticationSession​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancel

        public void cancel()
        Cancel an SFAuthenticationSession. If the view controller is already presented to load the webpage for authentication, it will be dismissed. Calling cancel on an already canceled session will have no effect.
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • initWithURLCallbackURLSchemeCompletionHandler

        public SFAuthenticationSession initWithURLCallbackURLSchemeCompletionHandler​(NSURL URL,
                                                                                     java.lang.String callbackURLScheme,
                                                                                     SFAuthenticationSession.Block_initWithURLCallbackURLSchemeCompletionHandler completionHandler)
        Returns a SFAuthenticationSession object.
        Parameters:
        URL - the initial URL pointing to the authentication webpage. Only supports URLs with http:// or https:// schemes.
        callbackURLScheme - the custom URL scheme that the app expects in the callback URL.
        completionHandler - the completion handler which is called when the session is completed successfully or canceled by user.
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • start

        public boolean start()
        Starts the SFAuthenticationSession instance after it is instantiated. start can only be called once for an SFAuthenticationSession instance. This also means calling start on a canceled session will fail.
        Returns:
        Returns YES if the session starts successfully.
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()