Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rharpavat committed Aug 24, 2023
1 parent 5a536f2 commit 6d679d2
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions pkg/pop/poptokenutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ func AcquirePoPTokenInteractive(
popClaims map[string]string,
scopes []string,
authority,
clientId string,
clientID string,
) (string, int64, error) {
client, err := public.New(clientId, public.WithAuthority(authority))
client, err := public.New(clientID, public.WithAuthority(authority))
if err != nil {
return "", -1, fmt.Errorf("unable to create public client: %w", err)
}
Expand All @@ -43,26 +43,33 @@ func AcquirePoPTokenConfidential(
scopes []string,
cred confidential.Credential,
authority,
clientId,
tenantId string,
clientID,
tenantID string,
) (string, int64, error) {
authnScheme := &PopAuthenticationScheme{
Host: popClaims["u"],
PoPKey: GetSwPoPKey(),
}
client, err := confidential.New(authority, clientId, cred)
client, err := confidential.New(
authority,
clientID,
cred,
)
if err != nil {
return "", -1, fmt.Errorf("unable to create confidential client: %w", err)
}
result, err := client.AcquireTokenSilent(
context.Background(),
scopes,
confidential.WithAuthenticationScheme(authnScheme),
confidential.WithTenantID(tenantId),
confidential.WithTenantID(tenantID),
)
if err != nil {
result, err = client.AcquireTokenByCredential(
context.Background(),
scopes,
confidential.WithAuthenticationScheme(authnScheme),
confidential.WithTenantID(tenantId),
confidential.WithTenantID(tenantID),
)
if err != nil {
return "", -1, fmt.Errorf("failed to create service principal PoP token using secret: %w", err)
Expand Down

0 comments on commit 6d679d2

Please sign in to comment.