MSALAuthority
Objective-C
@interface MSALAuthority : NSObject <NSCopying>
Swift
class MSALAuthority : NSObject, NSCopying
MSALAuthority represents an identity provider instance that MSAL can use to obtain tokens. For AAD it is of the form https://aad_instance/aad_tenant, where aad_instance is the directory host (e.g. https://login.microsoftonline.com) and aad_tenant is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)
Note
The MSALAuthority class is the base abstract class for the MSAL authority classes. Don’t try to create instance of it using alloc or new. Instead, either create one of its subclasses directly (MSALAADAuthority, MSALB2CAuthority) or use the factory methodauthorityWithURL:error: to create subclasses using an authority URL.
-
Normalized authority URL.
Declaration
Objective-C
@property (readonly, nonnull) NSURL *url;Swift
var url: URL { get }
-
Unavailable
Note
Use[MSALAuthority authorityWithURL:error:]insteadDeclaration
Objective-C
- (nonnull instancetype)init; -
Unavailable
Note
Use[MSALAuthority authorityWithURL:error:]insteadDeclaration
Objective-C
+ (nonnull instancetype)new;
-
Factory method that parses input authority URL and tries to detect its type automatically.
Note
This initializer will work in most AAD and some B2C cases. However, some valid authorities might be misclassified. Initialize
MSALAADAuthorityorMSALB2CAuthoritydirectly for better reliability.Declaration
Objective-C
+ (nullable MSALAuthority *)authorityWithURL:(nonnull NSURL *)url error: (NSError *_Nullable *_Nullable)error;Swift
/*not inherited*/ init(url: URL) throwsParameters
urlAuthority URL that MSAL can use to obtain tokens.
errorThe error that occurred creating the authority, if any, if you’re not interested in the specific error pass in nil.
View on GitHub