GIDAuthorizationUtil.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. @class OIDAuthorizationRequest;
  18. @class GIDSignInInternalOptions;
  19. NS_ASSUME_NONNULL_BEGIN
  20. /// The util class for authorization process.
  21. @interface GIDAuthorizationUtil : NSObject
  22. /// Creates the request to AppAuth to start the authorization flow.
  23. ///
  24. /// @param options The `GIDSignInInternalOptions` object to provide serverClientID, hostedDomain,
  25. /// clientID, scopes, loginHint and extraParams.
  26. /// @param emmSupport The EMM support info string.
  27. + (OIDAuthorizationRequest *)
  28. authorizationRequestWithOptions:(GIDSignInInternalOptions *)options
  29. emmSupport:(nullable NSString *)emmSupport;
  30. /// Unions granted scopes with new scopes or returns an error if the new scopes are the subset of
  31. /// the granted scopes.
  32. ///
  33. /// @param scopes The existing scopes.
  34. /// @param newScopes The new scopes to add.
  35. /// @param error The reference to the error.
  36. /// @return The array of all scopes or nil if there is an error.
  37. + (nullable NSArray<NSString *> *)
  38. resolvedScopesFromGrantedScoped:(NSArray<NSString *> *)scopes
  39. withNewScopes:(NSArray<NSString *> *)newScopes
  40. error:(NSError * __autoreleasing *)error;
  41. @end
  42. NS_ASSUME_NONNULL_END