public class ASWebAuthenticationSession extends NSObject
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 ASWebAuthenticationSession, 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 ASWebAuthenticationSessionErrorCodeCanceledLogin.
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 ASWebAuthenticationSessionErrorCodeCanceledLogin.
The app can cancel the session by calling -[ASWebAuthenticationSession cancel]. This will also dismiss the view controller that is showing the web service's login page.
| Modifier and Type | Class and Description |
|---|---|
static interface |
ASWebAuthenticationSession.Block_initWithURLCallbackURLSchemeCompletionHandler |
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
ASWebAuthenticationSession(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
static ASWebAuthenticationSession |
alloc() |
static ASWebAuthenticationSession |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
void |
cancel()
Cancel an ASWebAuthenticationSession.
|
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
boolean |
canStart()
Returns whether the session can be successfully started.
|
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
static long |
hash_static() |
ASWebAuthenticationSession |
init() |
ASWebAuthenticationSession |
initWithURLCallbackURLSchemeCompletionHandler(NSURL URL,
java.lang.String callbackURLScheme,
ASWebAuthenticationSession.Block_initWithURLCallbackURLSchemeCompletionHandler completionHandler)
Returns an ASWebAuthenticationSession object.
|
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
static ASWebAuthenticationSession |
new_objc() |
boolean |
prefersEphemeralWebBrowserSession()
Indicates whether this session should ask the browser for an ephemeral session.
|
ASWebAuthenticationPresentationContextProviding |
presentationContextProvider()
Provides context to target where in an application's UI the authorization view should be shown.
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
void |
setPrefersEphemeralWebBrowserSession(boolean value)
Indicates whether this session should ask the browser for an ephemeral session.
|
void |
setPresentationContextProvider_unsafe(ASWebAuthenticationPresentationContextProviding value)
Provides context to target where in an application's UI the authorization view should be shown.
|
void |
setPresentationContextProvider(ASWebAuthenticationPresentationContextProviding value)
Provides context to target where in an application's UI the authorization view should be shown.
|
static void |
setVersion_static(long aVersion) |
boolean |
start()
Starts the ASWebAuthenticationSession instance after it is instantiated.
|
static org.moe.natj.objc.Class |
superclass_static() |
static long |
version_static() |
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeyprotected ASWebAuthenticationSession(org.moe.natj.general.Pointer peer)
public static boolean accessInstanceVariablesDirectly()
public static ASWebAuthenticationSession alloc()
public static ASWebAuthenticationSession allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public void cancel()
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public static long hash_static()
public ASWebAuthenticationSession init()
public ASWebAuthenticationSession initWithURLCallbackURLSchemeCompletionHandler(NSURL URL, java.lang.String callbackURLScheme, ASWebAuthenticationSession.Block_initWithURLCallbackURLSchemeCompletionHandler completionHandler)
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.public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static ASWebAuthenticationSession new_objc()
public boolean prefersEphemeralWebBrowserSession()
Ephemeral web browser sessions do not not share cookies or other browsing data with a user's normal browser session. This value is NO by default. Setting this property after calling -[ASWebAuthenticationSession start] has no effect.
public ASWebAuthenticationPresentationContextProviding presentationContextProvider()
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public void setPrefersEphemeralWebBrowserSession(boolean value)
Ephemeral web browser sessions do not not share cookies or other browsing data with a user's normal browser session. This value is NO by default. Setting this property after calling -[ASWebAuthenticationSession start] has no effect.
public void setPresentationContextProvider_unsafe(ASWebAuthenticationPresentationContextProviding value)
public void setPresentationContextProvider(ASWebAuthenticationPresentationContextProviding value)
public static void setVersion_static(long aVersion)
public boolean start()
start can only be called once for an ASWebAuthenticationSession instance. This also means calling start on a canceled session will fail.
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()
public boolean canStart()