Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…tion-library-for-java into avdunn/api-fix
  • Loading branch information
Avery-Dunn committed Jun 26, 2024
2 parents 7e8874b + c134ec2 commit 5f6c2e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private ITenantProfile getTenantProfile() {
private final String scopes;

@Builder.Default
private final AuthenticationResultMetadata metadata = new AuthenticationResultMetadata();
private final AuthenticationResultMetadata metadata = AuthenticationResultMetadata.builder().build();

@Getter(value = AccessLevel.PACKAGE)
private final Boolean isPopAuthorization;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package com.microsoft.aad.msal4j;

import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
Expand All @@ -16,17 +17,9 @@
@Accessors(fluent = true)
@Getter
@Setter(AccessLevel.PACKAGE)
@Builder
public class AuthenticationResultMetadata implements Serializable {

private TokenSource tokenSource;

/**
* Sets default metadata values. Used when creating an {@link IAuthenticationResult} before the values are known.
*/
AuthenticationResultMetadata() {
}

AuthenticationResultMetadata(TokenSource tokenSource) {
this.tokenSource = tokenSource;
}
private Long refreshOn;
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ private AuthenticationResult createAuthenticationResultFromOauthHttpResponse(
refreshOn(response.getRefreshIn() > 0 ? currTimestampSec + response.getRefreshIn() : 0).
accountCacheEntity(accountCacheEntity).
scopes(response.getScope()).
metadata(new AuthenticationResultMetadata(TokenSource.IDENTITY_PROVIDER)).
metadata(AuthenticationResultMetadata.builder()
.tokenSource(TokenSource.IDENTITY_PROVIDER)
.refreshOn(response.getRefreshIn() > 0 ? currTimestampSec + response.getRefreshIn() : 0)
.build()).
build();

} else {
Expand Down

0 comments on commit 5f6c2e0

Please sign in to comment.