Skip to content

Conversation

@AkshatG6
Copy link
Contributor

@AkshatG6 AkshatG6 commented Sep 3, 2025

This pull request introduces the GIDTokenClaim class, which allows for requesting specific OIDC claims for an ID token.

Key changes:

  • Adds the GIDTokenClaim class to represent a single OIDC claim.
  • Includes factory methods for creating essential and non-essential auth_time claims.
  • Provides unit tests to validate the implementation.

@AkshatG6 AkshatG6 requested a review from mdmathias September 3, 2025 16:13

- (void)testAuthTimeClaim_PropertiesAreCorrect {
GIDTokenClaim *claim = [GIDTokenClaim authTimeClaim];
XCTAssertEqualObjects(claim.name, @"auth_time");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps useful to add string constants to GIDTokenClaim.h: kAuthTimeClaim. You could then compare to that here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the string constant.

@AkshatG6 AkshatG6 requested a review from mdmathias September 4, 2025 17:55
#import <XCTest/XCTest.h>
#import "GoogleSignIn/Sources/Public/GoogleSignIn/GIDTokenClaim.h"

static NSString *const kAuthTimeClaimName = @"auth_time";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be declared in GIDTokenClaim.h, implemented and used in GIDTokenClaim.m

@AkshatG6 AkshatG6 requested a review from mdmathias September 4, 2025 22:43
@AkshatG6 AkshatG6 merged commit 7f75975 into gandhiakshat/sbc-auth_time Sep 5, 2025
13 checks passed
@AkshatG6 AkshatG6 deleted the gandhiakshat/sbc-token_claim-object branch September 5, 2025 17:27
AkshatG6 added a commit that referenced this pull request Sep 9, 2025
This pull request introduces the `GIDTokenClaimsInternalOptions` class, a new component designed to handle the validation and JSON serialization of token claims.

Key changes:

* Adds the `GIDTokenClaimsInternalOptions` class to validate the token claims and return a JSON object.
* Adds the `GIDJSONSerializer` protocol with real and fake implementations to support serializing the token claims.
* Provides unit tests to validate the implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants