Skip to content

Commit 7999274

Browse files
handsomejack-42bgavrilMS
authored andcommitted
refactor(authority): use authority.ADFS instead of re-defined ADFS const
1 parent 80b1f35 commit 7999274

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

apps/internal/oauth/resolvers.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ import (
1818
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
1919
)
2020

21-
// ADFS is an active directory federation service authority type.
22-
const ADFS = "ADFS"
23-
2421
type cacheEntry struct {
2522
Endpoints authority.Endpoints
2623
ValidForDomainsInList map[string]bool
@@ -83,7 +80,7 @@ func (m *authorityEndpoint) cachedEndpoints(authorityInfo authority.Info, userPr
8380
defer m.mu.Unlock()
8481

8582
if cacheEntry, ok := m.cache[authorityInfo.CanonicalAuthorityURI]; ok {
86-
if authorityInfo.AuthorityType == ADFS {
83+
if authorityInfo.AuthorityType == authority.ADFS {
8784
domain, err := adfsDomainFromUpn(userPrincipalName)
8885
if err == nil {
8986
if _, ok := cacheEntry.ValidForDomainsInList[domain]; ok {
@@ -102,7 +99,7 @@ func (m *authorityEndpoint) addCachedEndpoints(authorityInfo authority.Info, use
10299

103100
updatedCacheEntry := createcacheEntry(endpoints)
104101

105-
if authorityInfo.AuthorityType == ADFS {
102+
if authorityInfo.AuthorityType == authority.ADFS {
106103
// Since we're here, we've made a call to the backend. We want to ensure we're caching
107104
// the latest values from the server.
108105
if cacheEntry, ok := m.cache[authorityInfo.CanonicalAuthorityURI]; ok {

0 commit comments

Comments
 (0)