Important: Starting
May 1, 2024, Apple
requires Privacy Manifests and signatures for iOS applications that use commonly-used SDKs, including GoogleSignIn-iOS. Upgrade to GoogleSignIn-iOS v7.1.0+ before May 1, 2024. Follow
our upgrade guide.
GoogleSignIn Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GIDConfiguration
@interface GIDConfiguration : NSObject <NSCopying, NSSecureCoding>
This class represents the client configuration provided by the developer.
-
The client ID of the app from the Google Cloud Console.
Declaration
Swift
var clientID: String { get }
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull clientID;
-
Declaration
Swift
var serverClientID: String? { get }
Objective-C
@property (nonatomic, readonly, nullable) NSString *serverClientID;
-
The Google Apps domain to which users must belong to sign in. To verify, check
GIDGoogleUser
‘s hostedDomain
property.
Declaration
Swift
var hostedDomain: String? { get }
Objective-C
@property (nonatomic, readonly, nullable) NSString *hostedDomain;
-
The OpenID2 realm of the home server. This allows Google to include the user’s OpenID
Identifier in the OpenID Connect ID token.
Declaration
Swift
var openIDRealm: String? { get }
Objective-C
@property (nonatomic, readonly, nullable) NSString *openIDRealm;
-
Initialize a GIDConfiguration
object with a client ID.
Declaration
Swift
convenience init(clientID: String)
Objective-C
- (nonnull instancetype)initWithClientID:(nonnull NSString *)clientID;
Parameters
clientID
|
The client ID of the app.
|
Return Value
An initialized GIDConfiguration
instance.
-
Initialize a GIDConfiguration
object with a client ID and server client ID.
Declaration
Swift
convenience init(clientID: String, serverClientID: String?)
Objective-C
- (nonnull instancetype)initWithClientID:(nonnull NSString *)clientID
serverClientID:(nullable NSString *)serverClientID;
Parameters
clientID
|
The client ID of the app.
|
serverClientID
|
|
Return Value
An initialized GIDConfiguration
instance.
-
Initialize a GIDConfiguration
object by specifying all available properties.
Declaration
Swift
init(clientID: String, serverClientID: String?, hostedDomain: String?, openIDRealm: String?)
Objective-C
- (nonnull instancetype)initWithClientID:(nonnull NSString *)clientID
serverClientID:(nullable NSString *)serverClientID
hostedDomain:(nullable NSString *)hostedDomain
openIDRealm:(nullable NSString *)openIDRealm;
Parameters
clientID
|
The client ID of the app.
|
serverClientID
|
|
hostedDomain
|
The Google Apps domain to be used.
|
openIDRealm
|
The OpenID realm to be used.
|
Return Value
An initialized GIDConfiguration
instance.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-19 UTC.
[null,null,["Last updated 2025-05-19 UTC."],[[["\u003cp\u003e\u003ccode\u003eGIDConfiguration\u003c/code\u003e stores client configuration data like client ID, server client ID, hosted domain, and OpenID realm.\u003c/p\u003e\n"],["\u003cp\u003eIt provides initializers to create configurations with varying levels of detail.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eclientID\u003c/code\u003e is the only required property, representing the app's client ID from Google Cloud Console.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eserverClientID\u003c/code\u003e allows specifying a server's client ID for backend authentication.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ehostedDomain\u003c/code\u003e and \u003ccode\u003eopenIDRealm\u003c/code\u003e offer further configuration for restricting sign-in and utilizing OpenID Connect.\u003c/p\u003e\n"]]],[],null,["# GoogleSignIn Framework Reference\n\nGIDConfiguration\n================\n\n @interface GIDConfiguration : NSObject \u003cNSCopying, NSSecureCoding\u003e\n\nThis class represents the client configuration provided by the developer.\n- `\n ``\n ``\n `\n\n ### [clientID](#/c:objc(cs)GIDConfiguration(py)clientID)\n\n `\n ` \n The client ID of the app from the Google Cloud Console. \n\n #### Declaration\n\n Swift \n\n var clientID: String { get }\n\n Objective-C \n\n @property (nonatomic, readonly) NSString *_Nonnull clientID;\n\n- `\n ``\n ``\n `\n\n ### [serverClientID](#/c:objc(cs)GIDConfiguration(py)serverClientID)\n\n `\n ` \n The client ID of the home server. This will be returned as the `audience` property of the\n OpenID Connect ID token. For more info on the ID token:\n \u003chttps://developers.google.com/identity/sign-in/ios/backend-auth\u003e \n\n #### Declaration\n\n Swift \n\n var serverClientID: String? { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nullable) NSString *serverClientID;\n\n- `\n ``\n ``\n `\n\n ### [hostedDomain](#/c:objc(cs)GIDConfiguration(py)hostedDomain)\n\n `\n ` \n The Google Apps domain to which users must belong to sign in. To verify, check\n [GIDGoogleUser](../Classes/GIDGoogleUser.html)'s `hostedDomain` property. \n\n #### Declaration\n\n Swift \n\n var hostedDomain: String? { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nullable) NSString *hostedDomain;\n\n- `\n ``\n ``\n `\n\n ### [openIDRealm](#/c:objc(cs)GIDConfiguration(py)openIDRealm)\n\n `\n ` \n The OpenID2 realm of the home server. This allows Google to include the user's OpenID\n Identifier in the OpenID Connect ID token. \n\n #### Declaration\n\n Swift \n\n var openIDRealm: String? { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nullable) NSString *openIDRealm;\n\n- `\n ``\n ``\n `\n\n ### [-initWithClientID:](#/c:objc(cs)GIDConfiguration(im)initWithClientID:)\n\n `\n ` \n Initialize a `GIDConfiguration` object with a client ID. \n\n #### Declaration\n\n Swift \n\n convenience init(clientID: String)\n\n Objective-C \n\n - (nonnull instancetype)initWithClientID:(nonnull NSString *)clientID;\n\n #### Parameters\n\n |------------------|---------------------------|\n | ` `*clientID*` ` | The client ID of the app. |\n\n #### Return Value\n\n An initialized `GIDConfiguration` instance.\n- `\n ``\n ``\n `\n\n ### [-initWithClientID:serverClientID:](#/c:objc(cs)GIDConfiguration(im)initWithClientID:serverClientID:)\n\n `\n ` \n Initialize a `GIDConfiguration` object with a client ID and server client ID. \n\n #### Declaration\n\n Swift \n\n convenience init(clientID: String, serverClientID: String?)\n\n Objective-C \n\n - (nonnull instancetype)initWithClientID:(nonnull NSString *)clientID\n serverClientID:(nullable NSString *)serverClientID;\n\n #### Parameters\n\n |------------------------|---------------------------|\n | ` `*clientID*` ` | The client ID of the app. |\n | ` `*serverClientID*` ` | The server's client ID. |\n\n #### Return Value\n\n An initialized `GIDConfiguration` instance.\n- `\n ``\n ``\n `\n\n ### [-initWithClientID:serverClientID:hostedDomain:openIDRealm:](#/c:objc(cs)GIDConfiguration(im)initWithClientID:serverClientID:hostedDomain:openIDRealm:)\n\n `\n ` \n Initialize a `GIDConfiguration` object by specifying all available properties. \n\n #### Declaration\n\n Swift \n\n init(clientID: String, serverClientID: String?, hostedDomain: String?, openIDRealm: String?)\n\n Objective-C \n\n - (nonnull instancetype)initWithClientID:(nonnull NSString *)clientID\n serverClientID:(nullable NSString *)serverClientID\n hostedDomain:(nullable NSString *)hostedDomain\n openIDRealm:(nullable NSString *)openIDRealm;\n\n #### Parameters\n\n |------------------------|------------------------------------|\n | ` `*clientID*` ` | The client ID of the app. |\n | ` `*serverClientID*` ` | The server's client ID. |\n | ` `*hostedDomain*` ` | The Google Apps domain to be used. |\n | ` `*openIDRealm*` ` | The OpenID realm to be used. |\n\n #### Return Value\n\n An initialized `GIDConfiguration` instance."]]