73 Commits

Author SHA1 Message Date
Andreas Linde
6d6012b0f6 Fixed self.validated not always being set to NO if restrictionEnforcementFrequency is set to BITAuthenticatorAppRestrictionEnforcementOnAppActive 2013-12-04 14:08:08 +01:00
Andreas Linde
fe9bbd55e9 Fix two block related memory issues in BITAuthenticator 2013-11-10 22:44:54 +01:00
Andreas Linde
1341668224 Use UTF8 encoding for auth data 2013-11-04 16:27:34 +01:00
Stephan Diederich
92a0fe92c5 Merge branch 'feature/WebBasedAuthentication' into develop 2013-10-18 18:12:58 +02:00
Stephan Diederich
72c8033119 cleanup
remove dispatch_once. It should be safe to call this multiple times.
Although in the default use case this makes pretty much no sense,
but for the demo app it's nice to have.
2013-10-17 18:55:02 +02:00
Stephan Diederich
42e0882eb8 add missing localized error message
if there's no network response, also show a proper error.
2013-10-14 14:05:20 +02:00
Stephan Diederich
6a932e4da5 re-validate once alert-view was dismissed
* factor out common validate method
* call it in authenticate and after validation-error was dismissed
* don't reset identification if validation failed - it might have only been
a short network outage.
2013-10-14 14:01:32 +02:00
Stephan Diederich
28b08fa804 add "webAuth" identificationType 2013-10-11 17:18:04 +02:00
Stephan Diederich
00ad57b245 rename ivar
adjust name so that it's not that easy to confuse
it with the identificationType. This is only the type of
the identifier.
2013-10-11 17:18:01 +02:00
Stephan Diederich
98bcbcb75f rename localizable string and add HockeyAuthenticationViewControllerWebAuthLoginDescription
prepare for WebAuth
2013-10-11 17:17:58 +02:00
Stephan Diederich
ddaab3246c let authenticator set the description of the viewController 2013-10-11 17:17:56 +02:00
Andreas Linde
498bd62cbb Remove automaticMode property since it is not needed any more
The developer needs to call at least `authenticateInstallation` instead.
2013-10-10 12:32:29 +02:00
Andreas Linde
7052f0cd7a Require the user to call authenticateInstallation manually
This solves multiple issues:
- Possible crashes at startup because the app is already in the process of presenting another modal view. This way the developer can make sure that only one modal view is being presented
- If the app is showing e.g. a login view on startup, it is now not needed to turn off automatic mode and setup the complete auth workflow manually and simply invoke `authenticateInstallation` after the login view is either fully presented (`viewDidLoad` finished) or the user did log in
2013-10-10 02:39:44 +02:00
Stephan Diederich
1a28150ec0 [Authenticator] also check the host part of a given URL
This helps especially in case of a custom URL scheme, so that
BITAuthenticator doesn't reset the identification token if a URL
is passed in that wasn't meant to parsed by BITAuthenticator.

fixes #70
2013-10-04 11:53:50 +02:00
Stephan Diederich
9466ae387a remove assertion
it's actually OK and handled if response is nil
2013-09-26 16:00:28 +02:00
Stephan Diederich
4f4ed09cd4 add URL for HockeyApps identification site to public interface 2013-09-24 22:33:22 +02:00
Stephan Diederich
b22a42101e fix warning 2013-09-24 21:55:17 +02:00
Stephan Diederich
9ddcad6da7 only reset validation flag once we actually went to the background 2013-09-24 17:28:53 +02:00
Stephan Diederich
aff8c0a9a9 allow to specify a custom URL scheme 2013-09-24 17:09:15 +02:00
Stephan Diederich
1616403e61 update needsValidation
return YES even if already validated but
there's a version mismatch.
2013-09-24 14:05:04 +02:00
Stephan Diederich
c2c6558687 redo BITAuthenticator interface
given the good feedback we got, this is take 2
of the BITAuthenticator interface.
It's simplified, cleaned up and now allows full
control over the authentication process.
Major changes:
* manual mode
  Authenticator provides the bits to show the
  viewController to identify the user as well as to
  trigger validation on behalf of the developer.
* process separation
  identification and app-usage-restriction are now
  2 completely separated things.
* public identifier
  Authenticator now allows the developer to query
  parts of the information, e.g. the UDID or the user's
  emailaddy once identified
2013-09-23 23:15:56 +02:00
ipaterson
df7010ed8a Fixed recurring typo in manager initializers. 2013-09-23 13:39:59 -04:00
ipaterson
5808e5f799 The kBITAuthenticatorDidSkipOptionalLogin was not being reset upon cleanup because it is stored in NSUserDefaults rather than the keychain. 2013-09-20 13:19:56 -04:00
Stephan Diederich
3c59855edf show proper error when UDID it not allowed to access 2013-09-20 15:29:40 +02:00
Stephan Diederich
623c81e8d9 use keychain attribute thisDeviceOnly instead of custom validation
instead of storing the vendorIdentifier, use the keychain to store
the token on this device only
2013-09-20 15:29:40 +02:00
Stephan Diederich
4ad928683d fix passed in udid not validated
any udid could be passed, so it only
failed on next launch and showed the
view controller again.
2013-09-20 15:29:40 +02:00
Stephan Diederich
9243d012b9 cleanup
first authenticate depending on app state,
then register for appState changes.
2013-09-20 15:29:40 +02:00
Stephan Diederich
4ae09c9c4b allow developer to provide a custom parentViewController
instead of doing the presentation ourselves, use the
provided functionality in the HockeyBaseManager.
This also allows developer to provide their own viewController
by implementing
- (UIViewController *)viewControllerForHockeyManager:componentManager:; as
HockeyManager's delegate.

fixes #58
2013-09-19 20:37:02 +02:00
Thomas Dohmke
0d67c5d2cd bit_appAnonID already checks for the identifierForVendor. 2013-09-17 13:45:06 +02:00
Thomas Dohmke
63882f30c0 Don't use identifierForVendor on iOS 5. 2013-09-17 13:39:56 +02:00
Stephan Diederich
fda20a3716 fix authentication dialog presented when application wakes up in background
when startManager is called, it doesn't mean  the app is actually active,
e.g. in iOS7 when a background download finished.
So check for active state in startManager and potentially wait for an
didBecomeActive notification.
2013-09-15 20:58:12 +02:00
Stephan Diederich
4ccae96cd9 fix duplicate count of installation
even in "optional identification"-mode set the "validated"
flag only once the use either did identify himself or skipped
it.
2013-09-15 18:02:11 +02:00
Stephan Diederich
a4bc855705 cleanup, remove additional early return 2013-09-15 17:57:01 +02:00
Andreas Linde
64a168502e Move new auth strings into language file 2013-09-12 22:32:44 +02:00
Stephan Diederich
b23d4f3eb4 Merge branch 'feature/#19-verifyBetaUsers' into develop
meh, always update before doing work…
Conflicts:
	Classes/BITAuthenticator.m
	Classes/HockeySDK.h
2013-09-12 22:23:03 +02:00
Stephan Diederich
681c67a9dd redo authentication response parsing
* first check for HTTP Status codes
* then do parsing if it was a 200
* fix typo in error messages
* be more specific about the response
2013-09-12 22:16:44 +02:00
Andreas Linde
d7ae69860d Various documentation fixes and updates 2013-09-12 12:21:12 +02:00
Andreas Linde
67d56af15d Fix warnings when building with iOS 7 as deployment target 2013-09-12 11:26:19 +02:00
Andreas Linde
1cb91ae323 Some authenticator string updates 2013-09-11 20:44:34 +02:00
Stephan Diederich
c534e5d566 also reset auth token if authType changed
saves us a round-trip when validating, as when
the authType changed, server would return nope.
2013-09-11 16:46:07 +02:00
Stephan Diederich
3a8802aa20 also compare auth type
as the authToken changes with the type this should not be
necessary, but for the sake of completeness put it there.
2013-09-11 16:44:28 +02:00
Stephan Diederich
53f851afc5 always provide an error to the viewcontroller 2013-09-11 16:17:20 +02:00
Stephan Diederich
c44c923819 redo auth with user+password
* needs to be basic auth
* use base64 encoder from HockeyCoach
2013-09-11 16:17:20 +02:00
Stephan Diederich
3aeeae8e98 add more english localizations 2013-09-11 16:17:20 +02:00
Stephan Diederich
ea5452603b store the type of the token with the token itself
updater needs it as well and we actually don't want to send
the wrong type to the server
2013-09-11 14:52:33 +02:00
Andreas Linde
d93da3ee32 More authenticator integration
- Only start the updateManager if the installation is authenticated (not yet tested)
- Provide the installation data to the updateManager requests
- Some more documentation
- Authenticator defaults to BITAuthenticatorAuthTypeUDIDProvider and BITAuthenticatorValidationTypeNever
- Reset usage time if installation identification changes (not yet tested)
2013-09-11 14:05:09 +02:00
Andreas Linde
d9bcfbb88d Update license headers in new files 2013-09-11 12:57:27 +02:00
Stephan Diederich
148d10896a update isValid in startManager depending on validationType 2013-09-11 00:10:10 +02:00
Stephan Diederich
30b93a0468 only reauthenticate if validation failed 2013-09-11 00:05:22 +02:00
Stephan Diederich
1938e480cc fix auth-viewcontroller unusable after failed authentication 2013-09-10 23:57:00 +02:00