Git Product home page Git Product logo

azuread / azure-activedirectory-library-for-objc Goto Github PK

View Code? Open in Web Editor NEW
177.0 89.0 113.0 21.71 MB

The ADAL SDK for Objective C gives you the ability to add support for Work Accounts to your iOS and macOS applications with just a few lines of additional code. This SDK gives your application the full functionality of Microsoft Azure AD, including industry standard protocol support for OAuth2, Web API integration with user level consent, and two factor authentication support.

License: MIT License

Ruby 0.19% Objective-C 97.88% Python 1.07% Shell 0.09% Swift 0.07% Rich Text Format 0.02% C 0.69%

azure-activedirectory-library-for-objc's Introduction


This library, ADAL for iOS and macOS, will no longer receive new feature improvements. Instead, use the new library MSAL for iOS and macOS.

  • If you are starting a new project, you can get started with the MSAL for iOS and macOS docs for details about the scenarios, usage, and relevant concepts.
  • If your application is using the previous ADAL for iOS and macOS library, you can follow this migration guide to update to MSAL for iOS and macOS.
  • Existing applications relying on ADAL for iOS and macOS will continue to work.

Microsoft Azure Active Directory Authentication Library (ADAL) for iOS and macOS

=====================================

Code Samples Reference Docs Developer Guide

Release Versions

We recommend remaining up-to-date with the latest version of ADAL. The best place to check what the most recent version is is the releases page on GitHub, you can also subscribe the the Atom Feed from GitHub, or use a 3rd party tool like Sibbell to receive emails when a new version is released.

The only approved way to get the latest version is through a tagged release on GitHub, or a tool that relies on that data. Tools like CocoaPods can make it easier to set up your project dependencies and update to the latest release. ADAL follows the GitFlow branching model. You should never pull an ADAL version for release from any branch other then master, any other branch is for versions of ADAL still in development or testing, and are subject to change.

NOTE:

  • To work with iOS 15, you must have at least version 5.0.0. However, we recommend switching to version 6.0.0 since 5.0.0 won't be maintained.

  • To work with iOS 10-11.3 you must have at least version 2.2.5.

  • To work with iOS 11.3-12.4 you must have at least version 2.6.3.

  • To work with iOS 13+ (when built with Xcode 11) you must have at least version 2.7.14 or 4.0.2

  • ADAL supports iOS 10+ and macOS 10.11+. iOS 9 and macOS 10.10 support was dropped in ADAL 4.0.0 release.

  • WKWebView drops network connection if device got locked on iOS 12. It is by design and not configurable.

Build Status

The ADAL SDK for iOS and macOS gives you the ability to add support for Work Accounts to your application with just a few lines of additional code. This SDK gives your application the full functionality of Microsoft Azure AD, including industry standard protocol support for OAuth2, Web API integration with user level consent, and two factor authentication support. Best of all, it’s FOSS (Free and Open Source Software) so that you can participate in the development process as we build these libraries.

Contribution History

Stories in Ready

Throughput Graph

Samples and Documentation

We provide a full suite of sample applications and documentation on GitHub to help you get started with learning the Azure Identity system. This includes tutorials for native clients such as Windows, Windows Phone, iOS, macOS, Android, and Linux. We also provide full walkthroughs for authentication flows such as OAuth2, OpenID Connect, Graph API, and other awesome features.

Azure Identity samples for iOS is here: https://github.com/AzureADSamples/NativeClient-iOS

Community Help and Support

We leverage Stack Overflow to work with the community on supporting Azure Active Directory and its SDKs, including this one! We highly recommend you ask your questions on Stack Overflow (we're all on there!) Also browser existing issues to see if someone has had your question before.

We recommend you use the "adal" tag so we can see it! Here is the latest Q&A on Stack Overflow for ADAL: http://stackoverflow.com/questions/tagged/adal

SSO and Conditional Access Support

This library allows your application to support our Enterprise Mobility Suite, including Conditional Access, so businesses can use your application in their secure environment.

To configure your application to support these scenarios, please read this document: How to enable cross-app SSO on iOS using ADAL

Security Reporting

If you find a security issue with our libraries or services please report it to [email protected] with as much detail as possible. Your submission may be eligible for a bounty through the Microsoft Bounty program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting this page and subscribing to Security Advisory Alerts.

Contributing

All code is licensed under the MIT license and we triage actively on GitHub. We enthusiastically welcome contributions and feedback. You can clone the repo and start contributing now.

Quick Start

  1. Clone the repository to your machine
  2. Build the library or framework
  3. Add the ADAL library or framework your project

Download

We've made it easy for you to have multiple options to use this library in your iOS project:

Option 1: Git Submodule

If your project is managed in a git repository you can include ADAL as a git submodule. First check the GitHub Releases Page for the latest release tag. Replace <latest_release_tag> with that version.

git submodule add https://github.com/AzureAD/azure-activedirectory-library-for-objc adal
cd adal
git checkout tags/<latest_release_tag>
cd ..
git add adal
git commit -m "Use ADAL git submodule at <latest_release_tag>"
git push

We recommend only syncing to specific release tags to make sure you're at a known good point. We will not support versions of ADAL between release tags.

Option 2: Cocoapods

You can use CocoaPods to remain up to date with ADAL within a specific major version. Include the following line in your podfile:

pod 'ADAL', '~> 6.0'

You then you can run either pod install (if it's a new PodFile) or pod update (if it's an existing PodFile) to get the latest version of ADAL. Subsequent calls to pod update will update to the latest released version of ADAL as well.

ADAL is using submodules, so if you're using a specific branch of ADAL in your Podfile, you need to enable submodules, e.g.

pod 'ADAL', :git => 'https://github.com/AzureAD/azure-activedirectory-library-for-objc', :branch => 'branch-name', :submodules => true

See CocoaPods for more information on setting up a PodFile

Option 3: Source Zip

To download a copy of the source code, first make sure you're on the "master" branch and click "Clone or download" then "Download ZIP" in the upper right hand corner, or you can download it here

This is not recommended, as it leaves no infrastructure in place for being able to easily update to the latest version.

Usage

Caching

iOS

Keychain Setup

Click on your project in the Navigator pane in Xcode. Click on your application target and then the "Capabilities" tab. Scroll down to "Keychain Sharing" and flip the switch on. Add "com.microsoft.adalcache" to that list.

Alternatively you can disable keychain sharing by setting the keychain sharing group to nil or your application's bundle id.

    [[ADALAuthenticationSettings sharedInstance] setDefaultKeychainGroup:nil];
Inspecting the Cache

If you need to inspect the cache in your app, you can do it through the ADKeychainTokenCache interface.

macOS

Keychain is not directly supported by ADAL on macOS. The default caching implementation will keep around tokens for the life time of the process, but they will not be persisted. If you wish to persist tokens you must implement the ADALTokenCacheDelegate and provide it on AuthenticationContext creation

@protocol ADALTokenCacheDelegate <NSObject>

- (void)willAccessCache:(nonnull ADALTokenCache *)cache;
- (void)didAccessCache:(nonnull ADALTokenCache *)cache;
- (void)willWriteCache:(nonnull ADALTokenCache *)cache;
- (void)didWriteCache:(nonnull ADALTokenCache *)cache;

@end

In this delegate you can call -serialize and -deserialize on the cache object to save or update the cache in the form of an NSData binary blob.

Quick Start

The starting point for the API is in ADALAuthenticationContext.h header. ADALAuthenticationContext is the main class used for obtaining, caching and supplying access tokens.

How to quickly get a token from the SDK:

+ (void)getToken:(void (^)(NSString*))completionBlock;
{
    ADALAuthenticationError *error = nil;
    authContext = [ADALAuthenticationContext authenticationContextWithAuthority:@"https://login.microsoftonline.com/common"
                                                                        error:&error];
        
    [authContext acquireTokenWithResource:@"https://graph.windows.net"                 
                                 clientId:@"<Your Client ID>"                          // Comes from App Portal
                              redirectUri:[NSURL URLWithString:@"<Your Redirect URI>"] // Comes from App Portal
                          completionBlock:^(ADALAuthenticationResult *result)
    {
        if (AD_SUCCEEDED != result.status){
            // display error on the screen
            [self showError:result.error.errorDetails];
        }
        else{
            completionBlock(result.accessToken);
        }
    }];
}

Adding the Token to the authHeader to access APIs:

    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:yourAppURL];
    NSString *authHeader = [NSString stringWithFormat:@"Bearer %@", accessToken];
    [request addValue:authHeader forHTTPHeaderField:@"Authorization"];
            
    NSOperationQueue *queue = [[NSOperationQueue alloc] init];
            
    [NSURLConnection sendAsynchronousRequest:request
                                       queue:queue
                           completionHandler:^(NSURLResponse *response, NSData *data, NSError *error)
    {
    	// Process Response Here
    }];

Brokered Authentication

If your app requires conditional access or certificate authentication (currently in preview) support, you must set up your AuthenticationContext and redirectURI to be able to talk to the Azure Authenticator app.

Enable Broker Mode on Your Context

Broker is enabled on a per-authentication-context basis. You must set your credentials type if you wish ADAL to call to broker:

/*! See the ADCredentialsType enumeration definition for details */
@property ADALCredentialsType credentialsType;

The AD_CREDENTIALS_AUTO setting will allow ADAL to try to call out to the broker, AD_CREDENTIALS_EMBEDDED will prevent ADAL from calling to the broker.

Registering a URL Scheme

ADAL uses URLs to invoke the broker and then return back to your app. To finish that round trip you need a URL scheme registered for your app. We recommend making the URL scheme fairly unique to minimize the chances of another app using the same URL scheme.

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>com.MSOpenTech.MyTestiOSApp</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>x-msauth-mytestiosapp</string>
        </array>
    </dict>
</array>

LSApplicationQueriesSchemes

ADAL uses –canOpenURL: to check if the broker is installed on the device. in iOS 9 Apple locked down what schemes an application can query for. You will need to add “msauth” and "msauthv3" to the LSApplicationQueriesSchemes section of your info.plist file. Note that "msauthv3" scheme is needed when compiling with Xcode 11+.

<key>LSApplicationQueriesSchemes</key>
<array>
     <string>msauth</string>
     <string>msauthv3</string>
</array>

Redirect URI

This adds extra requirements on your redirect URI. Your redirect URI must be in the proper form.

<app-scheme>://<your.bundle.id>
ex: x-msauth-mytestiosapp://com.microsoft.mytestiosapp

This Redirect URI needs to be registered on the app portal as a valid redirect URI. Additionally a second "msauth" form needs to be registered to handle certificate authentication in Azure Authenticator.

msauth://code/<broker-redirect-uri-in-url-encoded-form>
ex: msauth://code/x-msauth-mytestiosapp%3A%2F%2Fcom.microsoft.mytestiosapp

iOS 13 support

If you adopted UISceneDelegate, you must also add an ADAL callback into the scene:openURLContexts: method.

This is needed so that ADAL can get a response from the Microsoft Authenticator application.

For example:

 - (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts
 {
     UIOpenURLContext *context = URLContexts.anyObject;
     NSURL *url = context.URL;
     NSString *sourceApplication = context.options.sourceApplication;
     
     [ADALAuthenticationContext handleADALResponse:url sourceApplication:sourceApplication];
 }

If you're not using UISceneDelegate functionality yet, you can ignore this step.

Diagnostics

Logs

ADAL relies heavily on logging to diagnose issues. It is highly recommended that you set an ADAL logging callback and provide a way for users to submit logs when they are having authentication issues.

Logging Callback

You can set a callback to capture ADAL logging and incorporate it in your own application's logging:

/*!
    The LogCallback block for the ADAL logger
 
    @param  logLevel        The level of the log message
    @param  message         A short log message describing the event that occurred, this string will not contain PII.
    @param  additionalInfo  A longer message that may contain PII and other details relevant to the event.
    @param  errorCode       An integer error code if the log message is an error.
    @param  userInfo        A dictionary with other information relevant to the log message. The information varies,
                            for most error messages the error object will be in the "error" key.
 */
typedef void (^LogCallback)(ADAL_LOG_LEVEL logLevel,
                            NSString *message,
                            NSString *additionalInfo,
                            NSInteger errorCode,
                            NSDictionary *userInfo);

Otherwise ADAL outputs to NSLog by default, which will print messages on the console.

Example Log Message

The message portion of ADAL iOS are in the format of ADALiOS [timestamp - correlation_id] message

ADAL [2015-06-22 19:42:53 - 1030CB25-798F-4A6F-97DF-04A3A3E9DFF2] ADAL API call [Version - 2.1.0]

Providing correlation IDs and timestamps are tremendously in tracking down issues. The only reliable place to retrieve them is from ADAL logging.

Logging Levels
  • ADAL_LOG_LEVEL_NO_LOG (Disable all logging)
  • ADAL_LOG_LEVEL_ERROR (Default level, prints out information only when errors occur)
  • ADAL_LOG_LEVEL_WARNING (Warning)
  • ADAL_LOG_LEVEL_INFO (Library entry points, with parameters and various keychain operations)
  • ADAL_LOG_LEVEL_Verbose (API tracing )

To set the logging level in your application call +[ADALLogger setLevel:]

[ADALLogger setLevel:ADAL_LOG_LEVEL_INFO]

Network Traces

You can use various tools to capture the HTTP traffic that ADAL generates. This is most useful if you are familiar with the OAuth protocol or if you need to provide diagnostic information to Microsoft or other support channels.

Charles is the easiest HTTP tracing tool in OSX. Use the following links to setup it up to correctly record ADAL network traffic. In order to be useful it is necessary to configure Charles, to record unencrypted SSL traffic. NOTE: Traces generated in this way may contain highly privileged information such as access tokens, usernames and passwords.
If you are using production accounts, do not share these traces with 3rd parties. If you need to supply a trace to someone in order to get support, reproduce the issue with a temporary account with usernames and passwords that you don't mind sharing.

ADALAuthenticationError

ADALAuthenticationErrors are provided in all callbacks in the ADALAuthenticationResult's error property when an error occurs. They can be used to have the application display more more informative errors to the user, however ADAL Error messages are not localized. All ADAuthenticationErrors are logged with the ADAL logger as well.

##Common problems

Application, using the ADAL library crashes with the following exception:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSString isStringNilOrBlank:]: unrecognized selector sent to class 0x13dc800'

Solution: Make sure that you add the -ObjC flag to "Other Linker Flags" build setting of the application. For more information, see Apple documentation for using static libraries:
https://developer.apple.com/library/ios/technotes/iOSStaticLibraries/Articles/configuration.html#//apple_ref/doc/uid/TP40012554-CH3-SW1.

Log ins are not persisting, Cache always returns empty

Solution: Either add the "com.microsoft.adalcache" keychain sharing entitlement to your application, or disable keychain sharing by passing in your application's bundle id in ADAuthenticationSettings:

    [[ADALAuthenticationSettings sharedInstance] setDefaultKeychainGroup:nil];

ADAL keeps returning SSL errors in iOS 9 and later

iOS 9 added App Transport Security (ATS). ATS restricts apps from accessing the internet unless they meet several security requirements including TLS 1.2 and SHA-256. It also prevents network traces that rely on self signed certs to crack SSL from working. Disabling ATS must be done in the Application's info.plist file, see documentation on the NSAppTransport info.plist key for more information.

License

Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");

We Value and Adhere to the Microsoft Open Source Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

azure-activedirectory-library-for-objc's People

Contributors

aashiman avatar ameyapat avatar antrix1989 avatar atomicdavid avatar brandwe avatar bryant1410 avatar codexeon avatar damienpontifex avatar danieldobalian avatar drvespa avatar evl5051 avatar hieunguyenmsft avatar jasoncoolmax avatar juan-arias avatar kaisong1990 avatar lovemaths avatar midella avatar mipetriu avatar msft-neiljac avatar msolivialuo avatar nerevarinerule avatar oldalton avatar omercs avatar partnerinflight avatar randallilama avatar rohitnarula7176 avatar rpangrle avatar unpluggedk avatar waffle-iron avatar weijjia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-activedirectory-library-for-objc's Issues

Unit tests intermittent failure

Unit tests are intermittently failing in multi-threaded scenarios when operating with the stored logs. Locks are needed around all log data manipulation.

HTTP status 403 after using "Can't access your account" page

To reproduce:

  1. Start app in logged out state
  2. Tap on "sign in" button (this starts our auth process and initiates ADALiOS library activity for our app)
  3. On the login page that appears in the ADALiOS web view, tap on "Can't access your account" link
  4. On the page that appears, tap the "Cancel" button (the one on the page, not the one at the top-left in the nav bar).
  5. Enter username.
  6. Enter password. Hit enter.

Expected result: Log in and taken into app.
Actual result: 403 error message in ADALiOS web view.

Notes:

  • I can get this to happen with an account with non-federated auth, and an account with federated auth.

Unable to open login page

Hi,
I am trying to change the login.windowsazure.net/msopentechbv.onmicrosoft.com
to my directory name as login.windowzazure.net/myappdomaniname.onmicrosoft.com.
and changed the client Id, resource url. But when I try to run it I am unable to see the login page.
Instead it gives me an error saying Sorry, but we're having trouble signing you in. We received bad request.
Please help me in this.
How to use this library with my windows azure active directory. in step by step procedure.
screen shot 2014-03-18 at 4 47 58 pm

Multi-resource refresh token not returned in the authentication result

Successful calls of acquireTokenWithResource often include multi-resource refresh token. In the current implementation, this token is stored correctly in the cache, but not returned in the ADAuthorizationResult object.
Unit tests should be expanded to ensure that the refresh token is always present in the result object.

Formalize handling of iOS shared app keychain context identifier

Currently our code is hard-coded to use a app keychain context identifier from Boris' personal developer account. We cannot ship this. Options, in priority order:

  1. Detect dynamically at runtime the app context ID to which we can append com.Microsoft.WorkplaceJoin
  2. Allow the calling app to pass in the context identifier.
  3. Use a hardcoded identifier from a Microsoft account, but add code to validate the calling apps permission at runtime. That is, fail fast with a clear message to ensure a smooth experience for the app developer.

Remove locks from the logging

Currently the logging has a lock around each log request. This log may slow down the application and should be removed, leaving up to the callback to be implemented in a thread-safe manner. Additionally, the callback setting should be made available only once at the beginning of the app. The latter is required in order to avoid locking around calling the callback.

ADALiOS cocoapod fails to install

platform :ios, '6.0'
pod 'ADALiOS', '~> 1.0.1'

[!] /usr/local/bin/git clone [email protected]:AzureAD/azure-activedirectory-library-for-objc.git /Users/geoff/Library/Caches/CocoaPods/GitHub/d39845a6718daceccb2656c617848db7d6d18d0b --mirror

Cloning into bare repository '/Users/geoff/Library/Caches/CocoaPods/GitHub/d39845a6718daceccb2656c617848db7d6d18d0b'...

Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

API method AcquireTokenSilent

Remove PromptBehavior.Never/CacheOnly

API method AcquireTokenSilent will be added with same behavior to .NET/WinRT, iOS, Android. It will do cache lookup and refresh token request. There is no UI component here.

Cocoapod

I was trying to integrate the library to a new project. I want to use cocoapods.
When i run the pod install command i´m getting this error:
[!] Unable to find a specification for ADALiOS (~> 0.5.1-alpha).

Seems that there is an issue, or maybe is not ready yet for pods management.
Can you take a look?
This is the pod i´m using

pod "AFNetworking", "> 2.0"
pod "ADALiOS", "
> 0.5.1-alpha"

Thanks!

Issue using Static Libraries + Adal

Hi,

I'm developing an application that uses 3 static libraries.
A base Static Library that is inherited by 2 libraries, and then I use in the app the two libraries. Also I have the Adal Library linked in my IOS app.
This mix of libraries got me the next error:
- duplicate symbols for architecture x86_64.

So I deleted the other linker flag -ObjC from my ios app and changed the -Match-o Type from Static Library to Dynamic Libray in the Adal project and all worked fine.

Could you review this (this change resolve the issue
NSInvalidArgumentException', reason: '+[NSString isStringNilOrBlank:]: unrecognized selector sent to class 0x13dc800'

Regards
Gustavo

Login page is shown for a split second and then dissappear

When calling Acquire Token, a login page is shown for a split second and then disappear. Ask: make it silent.

Omer Cansizoglu: "We have a silent webview logic in ADAL.NET and ADAL.Native but not in mobile platforms.

User interaction: You don’t know that until you show the webview. Silent webview logic in other platforms launches hidden UI. If it is successfully gets the authorization code, it exchanges auth code for token."

ADAL-OSX framework project settings do not specify an INSTALL_PATH

OSX-Universal branch: Without an INSTALL_PATH, the framework is built with the default value: /Library/Frameworks/. When the framework is linked into an application, and packaged into the app bundle, we see a runtime exception:

dyld: Library not loaded: /Library/Frameworks/ADAL-OSX.framework/Versions/A/ADAL-OSX
  Referenced from: <snip>/RMSTestApp.app/Contents/MacOS/RMSTestApp
  Reason: image not found

To solve this problem, the INSTALL_PATH needs to be set to @rpath, following which the framework is expected to be packaged into the app bundle.

An app using ADAL OSX, packaged for distribution, fails to run.

The app runs fine when it is not linked to ADAL OSX. When it is linked to ADAL, it fails with the below error :

Check with the developer to make sure HelloWorld works with this version of OS X. You may need to reinstall the application. Be sure to install any available updates for the application and OS X.

Also, the app works fine when run from Xcode.

ADAL to provide API that can leverage refresh in refresh_session parameter

There is a scenario where clients may look for updated claims in the token since they acquire the token (for example: device claim) while the client already has valid not-expired access and refresh-tokens. The forces clients to clear available tokens from the cache and call acquireTokens again with extra parameters. It would be ideal logic can be folded in to the ADAL APIs.

Allow caller to pass in a UI/WebView

The Win32 ADAL API allows the caller to pass in a IWebBrowser object, similarly the iOS & Mac APIs should allow the caller to pass in a UI/WebView so it can be integrated into our existing authentication UI. (This also would remove the requirement for a storyboard and the use of localized resources within ADAL)

Implementing a custom login page

Is there any way to implement a custom login page using Active Directory? I'd like for users of my app to use my custom login page and then just pass their credentials without using the default web view login page. Thanks

OSX 32-bit version memory leak for ADUserInformation

The method ADUserInformation::copyWithZone leaks one string on every ADAL acquireToken call. The following line:

ADUserInformation* info = [[ADUserInformation allocWithZone:zone] initWithUserId:[self.userId copyWithZone:zone]];

Should be replaced with this one to avoid double-increment of the "userId" refcount:

ADUserInformation* info = [[ADUserInformation allocWithZone:zone] initWithUserId:self.userId];

Reason: The initializer for ADUserInformation object already increments the reference to the userId string and so does the "copyWithZone".

Everything in iPAL needs prefixes on method names and class names

A class name like "HTTPWebRequest" and "HTTPWebResponse" is generic enough that the likelihood some developer will try to integrate the library with a class with the same name is fairly high. These should be prefixed to prevent potential class name conflicts.

The same goes with methods in categories on Foundation classes (NSURL, NSDictionary, NSString).

Precompiled header issues

For faster building, I have added too many of the library headers in the precompiled headers of xCode for the ADAL project. Unfortunately, this causes a problem later when building the framework across multiple configurations. Due to a bug in xCode, the build just fails when one or more of the headers are modified (e.g. after syncing). The workaround is easy - delete the precompiled headers. However, this workaround is not obvious and headers are located in some deep/hidden folder.

The proposed solution is to remove all of the ADAL headers from the .pch (precompiled header) files. This will slow down the build, but will make it significantly more stable.

ADAL Library does not report timeout errors

  1. Start Adal authentication with an Office 365 account
  2. Type in you email address and password
  3. go to network link conditioner and turn on 100% loss
  4. click sign in

actual
no error is ever reported to the app calling the library, to inform them that the connection timed out.

expected
The calling app should be notified that the operation timed out. The adal library should have a timeout.

Requirement for ways for the library consumers to clear auth related HTTP cookies.

ADAL login has been changed to NOT clear any cookies to keep it consistent with other platforms - need a interface/property on the library to find out all the URLs visited by the lib and therefore have the ability to clear those cookies from the app. Another option is for the lib to callback a delegate at URL load start/stop. The app can do the tracking.

Expose the access token directly in the authentication result

The access token is the whole reason developers call acquireTokenWithResource method. The proposal suggests adding a calculated property named 'accessToken' which is calculated off the 'tokenCacheStoreItem' and its 'accessToken' property. This way developers can use code like this:
[context acquireTokenWithResource:...
completionBlock:^(ADAuthenticationResource* res){
if (res.accessToken)
{
... //use res.accessToken
}
}

Calling AcquireToken() again after user clicks "Cancels" on the login page fails

With the below error :

ADALiOS: ERROR: Error raised: 1. Additional Information: Domain: ADAuthenticationErrorDomain ProtocolCode:(null) Details:The user has cancelled the authorization.. ErrorCode: 1.
2014-03-19 09:38:13.409 ScenarioHealthTracker[5213:70b] Warning: Attempt to present <UINavigationController: 0x8fba040> on <_UIModalItemAppViewController: 0x8faaac0> which is already presenting <_UIModalItemsPresentingViewController: 0x8d87f60>

During the first AcquireToken call ADAL creates a UINavigationController("LogonNavigator") for the Login page and presents it as a modal view controller. During the second call, ADAL tries to do the same and fails with the error above.

The .framework builds do not span all architectures

The .framework build for the simulator does not work on the device and vice versa. This makes the .framework produced unusable, as developers cannot use it to test on simulator and then run on the device.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.