GIDAuthorizationFlowProcessor.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright 2023 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. NS_ASSUME_NONNULL_BEGIN
  18. @class GIDSignInInternalOptions;
  19. @class OIDAuthorizationResponse;
  20. @protocol GIDAuthorizationFlowProcessor <NSObject>
  21. /// The state of the authorization flow.
  22. @property(nonatomic, readonly, getter=isStarted) BOOL start;
  23. /// Starts the authorization flow.
  24. ///
  25. /// @param options The @GIDSignInInternalOptions object to provide serverClientID, hostedDomain,
  26. /// clientID, scopes, loginHint and extraParams.
  27. /// @param emmSupport The EMM support info string.
  28. /// @param completion The block that is called on completion asynchronously.
  29. - (void)startWithOptions:(GIDSignInInternalOptions *)options
  30. emmSupport:(nullable NSString *)emmSupport
  31. completion:(void (^)(OIDAuthorizationResponse *_Nullable authorizationResponse,
  32. NSError *_Nullable error))completion;
  33. /// Handles the custom scheme URL opened by SFSafariViewController to cleanup UI on iOS 10.
  34. ///
  35. /// @param url The redirect URL invoked by the server.
  36. /// @return YES if the passed URL matches the expected redirect URL and was consumed, NO otherwise.
  37. - (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)url;
  38. /// Cancels the authorization flow.
  39. - (void)cancelAuthenticationFlow;
  40. @end
  41. NS_ASSUME_NONNULL_END