Conversation
5517451 to
83ca36e
Compare
| return resp, err | ||
| } | ||
|
|
||
| func (c Client) DSTSInstanceDiscovery(ctx context.Context, authorityInfo Info) (InstanceDiscoveryResponse, error) { |
There was a problem hiding this comment.
Very surprised to see this, was under the impression that dSTS doesn't support instance discovery.
There was a problem hiding this comment.
Correct, instance discovery is not supported.
83ca36e to
35a4182
Compare
| authorizationEndpoint = "https://%v/%v/oauth2/v2.0/authorize" | ||
| instanceDiscoveryEndpoint = "https://%v/common/discovery/instance" | ||
| aadInstanceDiscoveryEndpoint = "https://%v/common/discovery/instance" | ||
| dstsInstanceDiscoveryEndpoint = "https://%v/dstsv2/common/discovery/instance" |
| authorityType = ADFS | ||
| case "dstsv2": | ||
| if len(pathParts) != 3 { | ||
| return Info{}, errors.New(`dSTS authority must be an https URL such as "https://<authority>/dstsv2/<your tenant>"`) |
There was a problem hiding this comment.
hard-coded tenant + added validation
apps/internal/oauth/resolvers.go
Outdated
| if authorityInfo.AuthorityType == authority.ADFS { | ||
| return fmt.Sprintf("https://%s/adfs/.well-known/openid-configuration", authorityInfo.Host), nil | ||
| } else if authorityInfo.AuthorityType == authority.DSTS { | ||
| resp, err := m.rest.Authority().DSTSInstanceDiscovery(ctx, authorityInfo) |
There was a problem hiding this comment.
Similar to ADFS, you can use a hard coded URL for dSTS. An example of this endpoint on dSTS
IMPORTANT! To connect to this endpoint you need to be on our VPN.
There was a problem hiding this comment.
hard-coded the url
5ee15d8 to
99f29ff
Compare
|
The field isn't used anywhere. Removing it simplifies the work on introducing authority abstraction. We might re-add it once we need it for anything.
…ONCall Parsing the url, then setting qv.Encode() manually to u.RawQuery feel like an overcomplicated approach of creating url for http request. Use the native constructor, which enforces ctx to be passed into the request, and do simple sprintf for url + query.
This enables adding the same const for dSTS later in the process.
This allows reusing the function for dSTS flow.
99f29ff to
a19302c
Compare
a19302c to
0d1c5c6
Compare
|
|
ready to be merged, ran against real dSTS instance as instructed, works |




No description provided.