Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move authority migration to common core #130

Merged
merged 71 commits into from
Sep 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
334d9b1
Move authority validation to common core.
antrix1989 Apr 30, 2018
66e060f
Use serial queue for aad validation requests.
antrix1989 May 4, 2018
9efe74a
Support v1 & v2 AAD api endpoints.
antrix1989 May 4, 2018
6103efe
Add ADFS authority cache.
antrix1989 May 5, 2018
718d5f5
Add openid metadata cache.
antrix1989 May 5, 2018
88584ce
Fix unit tests.
antrix1989 May 5, 2018
8cd8321
Merge branch 'dev' into sedemche/authorityAliases
antrix1989 May 8, 2018
28deb6d
Cover MSIDAuthority with unit tests. Fix openId configuration loading…
antrix1989 May 8, 2018
3fa5855
Cover B2C authority validation with tests.
antrix1989 May 10, 2018
10c0e5a
Cover AAD authority validation with tests.
antrix1989 May 10, 2018
8d1b88c
Cover ADFS authority validation with tests.
antrix1989 May 11, 2018
8964c86
Don't normalize authority on discovery.
antrix1989 May 13, 2018
564a53a
Test AAD api version.
antrix1989 May 13, 2018
c4920d6
Remove 'authority' parameter from auth discovery block.
antrix1989 May 13, 2018
1b9bdb6
Verify taht PassiveAuthEndpoint is a string.
antrix1989 May 14, 2018
45193a7
Fix parentheses position.
antrix1989 May 14, 2018
eaca231
Move open id configuration suffix to constants.
antrix1989 May 14, 2018
01853dc
Remove commented code.
antrix1989 May 14, 2018
e61f1f3
Rename authority metadata request.
antrix1989 May 14, 2018
6dfb0cb
Fix alignment.
antrix1989 May 14, 2018
1f6ecc1
Code style fixes.
antrix1989 May 14, 2018
95e35eb
Add nullability annotation to requests.
antrix1989 May 14, 2018
2904d21
Check for deprecated authority.
antrix1989 May 15, 2018
91e015b
Mark isAuthorityFormatValid as private method.
antrix1989 May 15, 2018
4e8216c
Add endpoint provider.
antrix1989 May 15, 2018
7fde238
Don't use upn in add MSIDAadAuthorityResolver.
antrix1989 May 16, 2018
11ec446
Rename method.
antrix1989 May 16, 2018
692263b
Rename protocol.
antrix1989 May 16, 2018
0310089
Changed error text.
antrix1989 May 16, 2018
36e92d7
Fix failing test. Fix code style.
antrix1989 May 16, 2018
606e3ec
Add nullability annotations.
antrix1989 May 16, 2018
7e6e4ae
Rename classes.
antrix1989 May 17, 2018
12eb8d3
Create session manager for http requests.
antrix1989 May 17, 2018
d473f37
Removed commented code.
antrix1989 May 17, 2018
1622598
Merge branch 'dev' into sedemche/authorityAliases
antrix1989 May 17, 2018
fa65a88
Merge branch 'sedemche/authorityAliases' into sedemche/shared_url_ses…
antrix1989 May 17, 2018
883fc44
Rename session manager & delegate.
antrix1989 May 20, 2018
f44b550
Rename MSIDHttpRequestErrorHandlerProtocol to MSIDHttpRequestErrorHan…
antrix1989 May 23, 2018
55fc7fc
Rename MSIDHttpRequestTelemetryProtocol to MSIDHttpRequestTelemetryHa…
antrix1989 May 23, 2018
adf32e8
Merge pull request #136 from AzureAD/sedemche/shared_url_session
antrix1989 May 25, 2018
24264e9
Add session delegate blocks.
antrix1989 May 29, 2018
3c5200d
Change completion blocks.
antrix1989 Jun 8, 2018
3e01653
Merge pull request #143 from AzureAD/sedemche/client_tls
antrix1989 Jun 27, 2018
3022965
Merge branch 'dev' into sedemche/authorityAliases
antrix1989 Aug 28, 2018
c087868
Fix tests and code after merge conflict.
antrix1989 Aug 28, 2018
4ddf021
Merge branch 'sedemche/authorityAliases' of github.com:AzureAD/micros…
antrix1989 Aug 29, 2018
582c07b
Use unmutable dictionary.
antrix1989 Aug 29, 2018
4b57b29
Small code style fixes.
antrix1989 Aug 29, 2018
851ac1b
Put context in MSIDDRSDiscoveryRequest initializer.
antrix1989 Aug 29, 2018
eb4b053
Fix realm validation.
antrix1989 Aug 29, 2018
9e48c84
Support windows.net authority.
antrix1989 Aug 29, 2018
c401073
Validate json response of drs discovery.
antrix1989 Aug 29, 2018
55a04ff
Add MSIDErrorAuthorityValidationWebFinger error.
antrix1989 Aug 30, 2018
17efef8
Document responseObjectForResponse method.
antrix1989 Aug 30, 2018
b7a13c1
Modify trusted hosts.
antrix1989 Aug 30, 2018
fd756c3
Invoke completition block when on prem & cloud drs discrovery failed.
antrix1989 Aug 30, 2018
f415923
Log host of challendge's protection space.
antrix1989 Aug 30, 2018
04e8c61
Check for nil opendID configuration url.
antrix1989 Aug 30, 2018
8c6a2c6
Verify that openIdConfigurationEndpoint is not nil and NSString.
antrix1989 Aug 31, 2018
c5d365a
Provide context in initializer.
antrix1989 Aug 31, 2018
1c16743
Use msidURLFormEncode instead of NSURLComponents encoding.
antrix1989 Aug 31, 2018
ed78126
Merge branch 'dev' into sedemche/authorityAliases
antrix1989 Aug 31, 2018
ae4c191
Cover error description parsing logic with tests.
antrix1989 Aug 31, 2018
3a28811
Don't store seesion delegate in ivar.
antrix1989 Aug 31, 2018
f5c9d91
Return early if json is nil.
antrix1989 Sep 1, 2018
86e859e
Remove semicolon.
antrix1989 Sep 1, 2018
bbc6a7c
Log as not pii.
antrix1989 Sep 1, 2018
917c0c3
Check error details in tests.
antrix1989 Sep 1, 2018
37a1276
Validate MSIDOpenIdConfigurationInfoRespons json.
antrix1989 Sep 1, 2018
69233e9
Remove swift settings from proj file.
antrix1989 Sep 1, 2018
0b676f1
Remove x-client-ver from query parameters of network request (it is s…
antrix1989 Sep 1, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
242 changes: 232 additions & 10 deletions IdentityCore/IdentityCore.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions IdentityCore/src/MSIDAADNetworkConfiguration.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright (c) Microsoft Corporation.
// All rights reserved.
//
// This code is licensed under the MIT License.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions :
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import <Foundation/Foundation.h>
#import "MSIDAADEndpointProviding.h"

@interface MSIDAADNetworkConfiguration : NSObject

@property (class, nullable) MSIDAADNetworkConfiguration *defaultConfiguration;

@property (nonatomic, nonnull) id<MSIDAADEndpointProviding> endpointProvider;

@property (nonatomic, nullable) NSString *aadApiVersion;

@property (nonatomic, nullable) NSString *aadAuthorityDiscoveryApiVersion;

@property (nonatomic, nullable) NSString *drsDiscoveryApiVersion;

@end
62 changes: 62 additions & 0 deletions IdentityCore/src/MSIDAADNetworkConfiguration.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright (c) Microsoft Corporation.
// All rights reserved.
//
// This code is licensed under the MIT License.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions :
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import "MSIDAADNetworkConfiguration.h"
#import "MSIDAADEndpointProvider.h"

static MSIDAADNetworkConfiguration *s_defaultConfiguration;

@implementation MSIDAADNetworkConfiguration

+ (void)initialize
{
if (self == [MSIDAADNetworkConfiguration self])
{
s_defaultConfiguration = [MSIDAADNetworkConfiguration new];
}
}

- (instancetype)init
{
self = [super init];
if (self)
{
_endpointProvider = [MSIDAADEndpointProvider new];
_aadAuthorityDiscoveryApiVersion = @"1.1";
_drsDiscoveryApiVersion = @"1.0";
}

return self;
}

+ (MSIDAADNetworkConfiguration *)defaultConfiguration
{
return s_defaultConfiguration;
}

+ (void)setDefaultConfiguration:(MSIDAADNetworkConfiguration *)defaultConfiguration
{
s_defaultConfiguration = defaultConfiguration;
}

@end
28 changes: 28 additions & 0 deletions IdentityCore/src/MSIDADFSType.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) Microsoft Corporation.
// All rights reserved.
//
// This code is licensed under the MIT License.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions :
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

typedef NS_ENUM(NSInteger, MSIDADFSType)
{
MSIDADFSTypeOnPrems,
MSIDADFSTypeCloud
};
3 changes: 2 additions & 1 deletion IdentityCore/src/MSIDError.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ typedef NS_ENUM(NSInteger, MSIDErrorCode)
=========================================================
*/
// Authority validation response failure
MSIDErrorAuthorityValidation = -51500,
MSIDErrorAuthorityValidation = -51500,
MSIDErrorAuthorityValidationWebFinger = -51501,

/*!
=========================================================
Expand Down
5 changes: 2 additions & 3 deletions IdentityCore/src/MSIDOAuth2Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ extern NSString *const MSID_OAUTH2_AUTHORIZATION;
extern NSString *const MSID_OAUTH2_AUTHORIZATION_CODE;
extern NSString *const MSID_OAUTH2_AUTHORIZATION_URI;
extern NSString *const MSID_OAUTH2_AUTHORITY;
extern NSString *const MSID_OAUTH2_AUTHORIZE_SUFFIX;
extern NSString *const MSID_OAUTH2_V2_AUTHORIZE_SUFFIX;
extern NSString *const MSID_OAUTH2_BEARER;
extern NSString *const MSID_OAUTH2_CLIENT_ID;
extern NSString *const MSID_OAUTH2_CLAIMS;
Expand All @@ -45,7 +43,6 @@ extern NSString *const MSID_OAUTH2_SCOPE;
extern NSString *const MSID_OAUTH2_STATE;
extern NSString *const MSID_OAUTH2_SUB_ERROR;
extern NSString *const MSID_OAUTH2_TOKEN;
extern NSString *const MSID_OAUTH2_TOKEN_SUFFIX;
extern NSString *const MSID_OAUTH2_INSTANCE_DISCOVERY_SUFFIX;
extern NSString *const MSID_OAUTH2_TOKEN_TYPE;
extern NSString *const MSID_OAUTH2_LOGIN_HINT;
Expand Down Expand Up @@ -118,3 +115,5 @@ extern NSString *const MSID_REFRESH_TOKEN_CACHE_TYPE;
extern NSString *const MSID_LEGACY_TOKEN_CACHE_TYPE;
extern NSString *const MSID_ID_TOKEN_CACHE_TYPE;
extern NSString *const MSID_GENERAL_TOKEN_CACHE_TYPE;

extern NSString *const MSID_OPENID_CONFIGURATION_SUFFIX;
6 changes: 3 additions & 3 deletions IdentityCore/src/MSIDOAuth2Constants.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
// THE SOFTWARE.

#import "MSIDOAuth2Constants.h"
#import "MSIDAADNetworkConfiguration.h"

NSString *const MSID_OAUTH2_ACCESS_TOKEN = @"access_token";
NSString *const MSID_OAUTH2_AUTHORIZATION = @"authorization";
NSString *const MSID_OAUTH2_AUTHORIZE_SUFFIX = @"/oauth2/authorize";
NSString *const MSID_OAUTH2_V2_AUTHORIZE_SUFFIX = @"/oauth2/v2.0/authorize";
NSString *const MSID_OAUTH2_AUTHORITY = @"authority";
NSString *const MSID_OAUTH2_AUTHORIZATION_CODE = @"authorization_code";
NSString *const MSID_OAUTH2_AUTHORIZATION_URI = @"authorization_uri";
Expand All @@ -47,7 +46,6 @@
NSString *const MSID_OAUTH2_STATE = @"state";
NSString *const MSID_OAUTH2_SUB_ERROR = @"suberror";
NSString *const MSID_OAUTH2_TOKEN = @"token";
NSString *const MSID_OAUTH2_TOKEN_SUFFIX = @"/oauth2/token";
NSString *const MSID_OAUTH2_INSTANCE_DISCOVERY_SUFFIX = @"common/discovery/instance";
NSString *const MSID_OAUTH2_TOKEN_TYPE = @"token_type";
NSString *const MSID_OAUTH2_LOGIN_HINT = @"login_hint";
Expand Down Expand Up @@ -119,3 +117,5 @@
NSString *const MSID_LEGACY_TOKEN_CACHE_TYPE = @"legacysingleresourcetoken";
NSString *const MSID_ID_TOKEN_CACHE_TYPE = @"idtoken";
NSString *const MSID_GENERAL_TOKEN_CACHE_TYPE = @"token";

NSString *const MSID_OPENID_CONFIGURATION_SUFFIX = @".well-known/openid-configuration";
29 changes: 29 additions & 0 deletions IdentityCore/src/network/MSIDAADEndpointProvider.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) Microsoft Corporation.
// All rights reserved.
//
// This code is licensed under the MIT License.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions :
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import <Foundation/Foundation.h>
#import "MSIDAADEndpointProviding.h"

@interface MSIDAADEndpointProvider : NSObject <MSIDAADEndpointProviding>

@end
92 changes: 92 additions & 0 deletions IdentityCore/src/network/MSIDAADEndpointProvider.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// Copyright (c) Microsoft Corporation.
// All rights reserved.
//
// This code is licensed under the MIT License.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions :
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import "MSIDAADEndpointProvider.h"
#import "MSIDAADNetworkConfiguration.h"

@implementation MSIDAADEndpointProvider

#pragma mark - MSIDEndpointProviderProtocol

- (NSURL *)oauth2AuthorizeEndpointWithUrl:(NSURL *)baseUrl
{
__auto_type apiVersion = [self aadApiVersionWithDelimiter];

return [baseUrl URLByAppendingPathComponent:[NSString stringWithFormat:@"/oauth2/%@authorize", apiVersion]];
}

- (NSURL *)oauth2TokenEndpointWithUrl:(NSURL *)baseUrl
{
__auto_type apiVersion = [self aadApiVersionWithDelimiter];

return [baseUrl URLByAppendingPathComponent:[NSString stringWithFormat:@"/oauth2/%@token", apiVersion]];
}

- (NSURL *)drsDiscoveryEndpointWithDomain:(NSString *)domain adfsType:(MSIDADFSType)type
Copy link
Member

Choose a reason for hiding this comment

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

I think drs discovery endpoint doesn't belong here, because it's ADFS and not AAD specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

created issue #211

{
if (type == MSIDADFSTypeOnPrems)
{
return [NSURL URLWithString:
[NSString stringWithFormat:@"https://enterpriseregistration.%@/enrollmentserver/contract", domain.lowercaseString]];
}
else if (type == MSIDADFSTypeCloud)
{
return [NSURL URLWithString:
[NSString stringWithFormat:@"https://enterpriseregistration.windows.net/%@/enrollmentserver/contract", domain.lowercaseString]];
}

return nil;
}

- (NSURL *)webFingerDiscoveryEndpointWithIssuer:(NSURL *)issuer
{
return [NSURL URLWithString:[NSString stringWithFormat:@"https://%@/.well-known/webfinger", issuer.host]];
}

- (NSURL *)openIdConfigurationEndpointWithUrl:(NSURL *)baseUrl
{
if (!baseUrl) return nil;

__auto_type apiVersion = [self aadApiVersionWithDelimiter];
__auto_type path = [NSString stringWithFormat:@"%@%@", apiVersion, MSID_OPENID_CONFIGURATION_SUFFIX];

return [baseUrl URLByAppendingPathComponent:path];
}

- (NSURL *)aadAuthorityDiscoveryEndpointWithHost:(NSString *)host
{
__auto_type trustedAuthority = [[NSURL alloc] initWithString:[NSString stringWithFormat:@"https://%@", host]];
return [trustedAuthority URLByAppendingPathComponent:MSID_OAUTH2_INSTANCE_DISCOVERY_SUFFIX];
}

#pragma mark - Private

- (NSString *)aadApiVersionWithDelimiter
{
__auto_type apiVersion = MSIDAADNetworkConfiguration.defaultConfiguration.aadApiVersion ?: @"";
__auto_type delimiter = MSIDAADNetworkConfiguration.defaultConfiguration.aadApiVersion ? @"/" : @"";

return [NSString stringWithFormat:@"%@%@", apiVersion, delimiter];
}

@end
42 changes: 42 additions & 0 deletions IdentityCore/src/network/MSIDAADEndpointProviding.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright (c) Microsoft Corporation.
// All rights reserved.
//
// This code is licensed under the MIT License.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions :
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import <Foundation/Foundation.h>
#import "MSIDADFSType.h"

@protocol MSIDAADEndpointProviding <NSObject>
Copy link
Member

Choose a reason for hiding this comment

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

nit: endpoint providing should apply also to basic Oauth2 flow, not only to AAD (e.g. we should be able to find an authorize endpoint or openid config for Google). We can take this as a separate issue though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comment about it in #211


- (NSURL *)oauth2AuthorizeEndpointWithUrl:(NSURL *)baseUrl;

- (NSURL *)oauth2TokenEndpointWithUrl:(NSURL *)baseUrl;

- (NSURL *)drsDiscoveryEndpointWithDomain:(NSString *)domain adfsType:(MSIDADFSType)type;

- (NSURL *)webFingerDiscoveryEndpointWithIssuer:(NSURL *)issuer;

- (NSURL *)openIdConfigurationEndpointWithUrl:(NSURL *)baseUrl;

- (NSURL *)aadAuthorityDiscoveryEndpointWithHost:(NSString *)host;


@end
Loading