diff --git a/Classes/BITAuthenticationViewController.h b/Classes/BITAuthenticationViewController.h index 9df4b0ae20..ef11f01dda 100644 --- a/Classes/BITAuthenticationViewController.h +++ b/Classes/BITAuthenticationViewController.h @@ -47,6 +47,12 @@ */ @property (nonatomic, assign) BOOL showsLoginViaWebButton; +/** + * Description shown on top of view. Should tell why this view + * was presented and what's next. + */ +@property (nonatomic, copy) NSString* tableViewTitle; + /** * can be set to YES to also require the users password * diff --git a/Classes/BITAuthenticationViewController.m b/Classes/BITAuthenticationViewController.m index d08aa5d9c6..689eed4030 100644 --- a/Classes/BITAuthenticationViewController.m +++ b/Classes/BITAuthenticationViewController.m @@ -142,6 +142,13 @@ _emailField.text = email; } } + +- (void)setTableViewTitle:(NSString *)viewDescription { + _tableViewTitle = [viewDescription copy]; + if(self.isViewLoaded) { + [self.tableView reloadData]; + } +} #pragma mark - UIViewController Rotation - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation { @@ -181,13 +188,7 @@ - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section { if (section == 0) { - if(self.showsLoginViaWebButton) { - return BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerWebLoginDescription"); - } else if(self.requirePassword) { - return BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerDataEmailAndPasswordDescription"); - } else { - return BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerDataEmailDescription"); - } + return self.tableViewTitle; } return nil; diff --git a/Classes/BITAuthenticator.h b/Classes/BITAuthenticator.h index 721e1c5560..ab8c721a16 100644 --- a/Classes/BITAuthenticator.h +++ b/Classes/BITAuthenticator.h @@ -75,6 +75,18 @@ typedef NS_ENUM(NSUInteger, BITAuthenticatorIdentificationType) { * for further documentation on this. */ BITAuthenticatorIdentificationTypeDevice, + /** + * Ask for the HockeyApp account email. + *

+ * This will present a user interface requesting the user to start a Safari based + * flow to login to HockeyApp (if not already logged in) and to share the hockeyapp + * account's email. + *

+ * If restrictApplicationUsage is enabled, the provided user account has to match a + * registered HockeyApp user who is a member or tester of the app. + * For identification purpose any HockeyApp user is allowed. + */ + BITAuthenticatorIdentificationTypeWebAuth, }; /** diff --git a/Classes/BITAuthenticator.m b/Classes/BITAuthenticator.m index 6ff9068a54..a12a41983c 100644 --- a/Classes/BITAuthenticator.m +++ b/Classes/BITAuthenticator.m @@ -167,11 +167,19 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut case BITAuthenticatorIdentificationTypeHockeyAppUser: viewController = [[BITAuthenticationViewController alloc] initWithDelegate:self]; viewController.requirePassword = YES; + viewController.tableViewTitle = BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerDataEmailAndPasswordDescription"); break; case BITAuthenticatorIdentificationTypeDevice: viewController = [[BITAuthenticationViewController alloc] initWithDelegate:self]; viewController.requirePassword = NO; viewController.showsLoginViaWebButton = YES; + viewController.tableViewTitle = BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerWebUDIDLoginDescription"); + break; + case BITAuthenticatorIdentificationTypeWebAuth: + viewController = [[BITAuthenticationViewController alloc] initWithDelegate:self]; + viewController.requirePassword = NO; + viewController.showsLoginViaWebButton = YES; + viewController.tableViewTitle = BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerWebAuthLoginDescription"); break; case BITAuthenticatorIdentificationTypeHockeyAppEmail: if(nil == self.authenticationSecret) { @@ -183,6 +191,7 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut } viewController = [[BITAuthenticationViewController alloc] initWithDelegate:self]; viewController.requirePassword = NO; + viewController.tableViewTitle = BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerDataEmailDescription"); break; } @@ -238,6 +247,7 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut //no break case BITAuthenticatorIdentificationTypeDevice: case BITAuthenticatorIdentificationTypeHockeyAppUser: + case BITAuthenticatorIdentificationTypeWebAuth: if(nil == self.installationIdentifier) { error = [NSError errorWithDomain:kBITAuthenticatorErrorDomain code:BITAuthenticatorNotIdentified @@ -287,8 +297,8 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut - (NSDictionary*) validationParameters { NSParameterAssert(self.installationIdentifier); - NSParameterAssert(self.installationIdentifierTypeString); - return @{self.installationIdentifierTypeString : self.installationIdentifier}; + NSParameterAssert(self.installationIdentifierParameterString); + return @{self.installationIdentifierParameterString : self.installationIdentifier}; } + (BOOL) isValidationResponseValid:(id) response error:(NSError **) error { @@ -495,7 +505,25 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut } - (NSURL *)deviceAuthenticationURL { - return [self.webpageURL URLByAppendingPathComponent:[NSString stringWithFormat:@"apps/%@/authorize", self.encodedAppIdentifier]]; + NSString *whatParameter = nil; + switch (self.identificationType) { + case BITAuthenticatorIdentificationTypeWebAuth: + whatParameter = @"email"; + break; + case BITAuthenticatorIdentificationTypeDevice: + whatParameter = @"udid"; + break; + case BITAuthenticatorIdentificationTypeAnonymous: + case BITAuthenticatorIdentificationTypeHockeyAppEmail: + case BITAuthenticatorIdentificationTypeHockeyAppUser: + NSAssert(NO,@"Should not happen. Those identification types don't need an authentication URL"); + return nil; + break; + } + NSURL *url = [self.webpageURL URLByAppendingPathComponent:[NSString stringWithFormat:@"apps/%@/authorize", self.encodedAppIdentifier]]; + NSParameterAssert(whatParameter && url.absoluteString); + url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?what=%@", url.absoluteString, whatParameter]]; + return url; } - (void)authenticationViewControllerDidTapWebButton:(UIViewController *)viewController { @@ -508,19 +536,46 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut - (BOOL) handleOpenURL:(NSURL *) url sourceApplication:(NSString *) sourceApplication annotation:(id) annotation { - BOOL isValidURL = NO; - NSString *udid = [self UDIDFromOpenURL:url annotation:annotation isValidURL:&isValidURL]; - if(NO == isValidURL) { - //do nothing, was not for us + //check if this URL was meant for us, if not return NO so the user can + //handle it + NSString *const kAuthorizationHost = @"authorize"; + NSString *urlScheme = _urlScheme ? : [NSString stringWithFormat:@"ha%@", self.appIdentifier]; + if(!([[url scheme] isEqualToString:urlScheme] && [[url host] isEqualToString:kAuthorizationHost])) { return NO; } + + NSString *installationIdentifier = nil; + NSString *localizedErrorDescription = nil; + switch (self.identificationType) { + case BITAuthenticatorIdentificationTypeWebAuth: { + NSString *email = nil; + [self.class email:&email andIUID:&installationIdentifier fromOpenURL:url]; + if(email) { + [self addStringValueToKeychain:email forKey:kBITAuthenticatorUserEmailKey]; + } else { + BITHockeyLog(@"No email found in URL: %@", url); + } + localizedErrorDescription = @"Failed to retrieve parameters from URL."; + break; + } + case BITAuthenticatorIdentificationTypeDevice: { + installationIdentifier = [self.class UDIDFromOpenURL:url annotation:annotation]; + localizedErrorDescription = @"Failed to retrieve UDID from URL."; + break; + } + case BITAuthenticatorIdentificationTypeHockeyAppEmail: + case BITAuthenticatorIdentificationTypeAnonymous: + case BITAuthenticatorIdentificationTypeHockeyAppUser: + NSAssert(NO, @"Should only be called for Device and WebAuth identificationType"); + return NO; + } - if(udid){ + if(installationIdentifier){ if(NO == self.restrictApplicationUsage) { [_authenticationController dismissViewControllerAnimated:YES completion:nil]; _authenticationController = nil; } - [self storeInstallationIdentifier:udid withType:BITAuthenticatorIdentificationTypeDevice]; + [self storeInstallationIdentifier:installationIdentifier withType:self.identificationType]; self.identified = YES; if(self.identificationCompletion) { self.identificationCompletion(YES, nil); @@ -528,12 +583,12 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut } } else { //reset token - [self storeInstallationIdentifier:nil withType:BITAuthenticatorIdentificationTypeDevice]; + [self storeInstallationIdentifier:nil withType:self.identificationType]; self.identified = NO; if(self.identificationCompletion) { NSError *error = [NSError errorWithDomain:kBITAuthenticatorErrorDomain code:BITAuthenticatorErrorUnknown - userInfo:@{NSLocalizedDescriptionKey : @"Failed to retrieve UDID from URL"}]; + userInfo:@{NSLocalizedDescriptionKey : localizedErrorDescription}]; self.identificationCompletion(NO, error); self.identificationCompletion = nil; } @@ -541,30 +596,33 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut return YES; } -- (NSString *) UDIDFromOpenURL:(NSURL *) url annotation:(id) annotation isValidURL:(BOOL*) isValid{ - NSString *const kAuthorizationHost = @"authorize"; - NSString *urlScheme = _urlScheme ? : [NSString stringWithFormat:@"ha%@", self.appIdentifier]; - if([[url scheme] isEqualToString:urlScheme] && [[url host] isEqualToString:kAuthorizationHost]) { - if(isValid) { - *isValid = YES; ++ (NSString *) UDIDFromOpenURL:(NSURL *) url annotation:(id) annotation { + NSString *query = [url query]; + NSString *udid = nil; + //there should actually only one + static NSString * const UDIDQuerySpecifier = @"udid"; + for(NSString *queryComponents in [query componentsSeparatedByString:@"&"]) { + NSArray *parameterComponents = [queryComponents componentsSeparatedByString:@"="]; + if(2 == parameterComponents.count && [parameterComponents[0] isEqualToString:UDIDQuerySpecifier]) { + udid = parameterComponents[1]; + break; } - NSString *query = [url query]; - NSString *udid = nil; - //there should actually only one - static NSString * const UDIDQuerySpecifier = @"udid"; - for(NSString *queryComponents in [query componentsSeparatedByString:@"&"]) { - NSArray *parameterComponents = [queryComponents componentsSeparatedByString:@"="]; - if(2 == parameterComponents.count && [parameterComponents[0] isEqualToString:UDIDQuerySpecifier]) { - udid = parameterComponents[1]; - break; - } + } + return udid; +} + ++ (void) email:(NSString**) email andIUID:(NSString**) iuid fromOpenURL:(NSURL *) url { + NSString *query = [url query]; + //there should actually only one + static NSString * const EmailQuerySpecifier = @"email"; + static NSString * const IUIDQuerySpecifier = @"iuid"; + for(NSString *queryComponents in [query componentsSeparatedByString:@"&"]) { + NSArray *parameterComponents = [queryComponents componentsSeparatedByString:@"="]; + if(email && 2 == parameterComponents.count && [parameterComponents[0] isEqualToString:EmailQuerySpecifier]) { + *email = parameterComponents[1]; + } else if(iuid && 2 == parameterComponents.count && [parameterComponents[0] isEqualToString:IUIDQuerySpecifier]) { + *iuid = parameterComponents[1]; } - return udid; - } else { - if(isValid) { - *isValid = NO; - } - return nil; } } @@ -651,13 +709,21 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut return [[NSUserDefaults standardUserDefaults] objectForKey:kBITAuthenticatorLastAuthenticatedVersionKey]; } -- (NSString *)installationIdentifierTypeString { - return [self.class stringForIdentificationType:self.identificationType]; +- (NSString *)installationIdentifierParameterString { + switch(self.identificationType) { + case BITAuthenticatorIdentificationTypeHockeyAppEmail: + case BITAuthenticatorIdentificationTypeWebAuth: + return @"iuid"; + case BITAuthenticatorIdentificationTypeHockeyAppUser: return @"auid"; + case BITAuthenticatorIdentificationTypeDevice: return @"udid"; + case BITAuthenticatorIdentificationTypeAnonymous: return @"uuid"; + } } + (NSString *)stringForIdentificationType:(BITAuthenticatorIdentificationType) identificationType { switch(identificationType) { case BITAuthenticatorIdentificationTypeHockeyAppEmail: return @"iuid"; + case BITAuthenticatorIdentificationTypeWebAuth: return @"webAuth"; case BITAuthenticatorIdentificationTypeHockeyAppUser: return @"auid"; case BITAuthenticatorIdentificationTypeDevice: return @"udid"; case BITAuthenticatorIdentificationTypeAnonymous: return @"uuid"; @@ -676,6 +742,7 @@ static NSString* const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAut switch (self.identificationType) { case BITAuthenticatorIdentificationTypeHockeyAppEmail: case BITAuthenticatorIdentificationTypeHockeyAppUser: + case BITAuthenticatorIdentificationTypeWebAuth: return [self stringValueFromKeychainForKey:kBITAuthenticatorUserEmailKey]; case BITAuthenticatorIdentificationTypeAnonymous: case BITAuthenticatorIdentificationTypeDevice: diff --git a/Classes/BITAuthenticator_Private.h b/Classes/BITAuthenticator_Private.h index 38c0ef6c39..c41134600a 100644 --- a/Classes/BITAuthenticator_Private.h +++ b/Classes/BITAuthenticator_Private.h @@ -50,9 +50,9 @@ @property (nonatomic, copy) NSString *lastAuthenticatedVersion; /** - * return the string used to identify this app against the HockeyApp backend. + * returns the type of the string stored in installationIdentifierParameterString */ -@property (nonatomic, copy, readonly) NSString *installationIdentifierTypeString; +@property (nonatomic, copy, readonly) NSString *installationIdentifierParameterString; /** * returns the string used to identify this app against the HockeyApp backend. diff --git a/Classes/BITHockeyManager.m b/Classes/BITHockeyManager.m index 3a94d55be4..a4b755035d 100644 --- a/Classes/BITHockeyManager.m +++ b/Classes/BITHockeyManager.m @@ -360,7 +360,7 @@ #if HOCKEYSDK_FEATURE_AUTHENTICATOR if (_authenticator) { [_updateManager setInstallationIdentification:[self.authenticator installationIdentifier]]; - [_updateManager setInstallationIdentificationType:[self.authenticator installationIdentifierTypeString]]; + [_updateManager setInstallationIdentificationType:[self.authenticator installationIdentifierParameterString]]; [_updateManager setInstallationIdentified:[self.authenticator isIdentified]]; } #endif diff --git a/Resources/de.lproj/HockeySDK.strings b/Resources/de.lproj/HockeySDK.strings index 7c0256e106..66abddb25d 100644 --- a/Resources/de.lproj/HockeySDK.strings +++ b/Resources/de.lproj/HockeySDK.strings @@ -240,7 +240,7 @@ "HockeyAuthenticatorViewControllerTitle" = "HockeyApp"; /* BITAuthenticatorAuthTypeUDIDProvider */ -"HockeyAuthenticationViewControllerWebLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; +"HockeyAuthenticationViewControllerWebUDIDLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; "HockeyAuthenticationViewControllerWebLoginButtonTitle" = "Open HockeyApp"; /* BITAuthenticatorAuthTypeEmail and BITAuthenticatorAuthTypeEmailAndPassword */ diff --git a/Resources/en.lproj/HockeySDK.strings b/Resources/en.lproj/HockeySDK.strings index 438bdbee3d..2b8e620795 100644 --- a/Resources/en.lproj/HockeySDK.strings +++ b/Resources/en.lproj/HockeySDK.strings @@ -240,9 +240,12 @@ "HockeyAuthenticatorViewControllerTitle" = "HockeyApp"; /* BITAuthenticatorAuthTypeUDIDProvider */ -"HockeyAuthenticationViewControllerWebLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; +"HockeyAuthenticationViewControllerWebUDIDLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; "HockeyAuthenticationViewControllerWebLoginButtonTitle" = "Open HockeyApp"; +/* BITAuthenticatorIdentificationTypeWebAuth */ +"HockeyAuthenticationViewControllerWebAuthLoginDescription" = "The developer has requested your HockeyApp account's email address. Tap below to open the HockeyApp website and authorize access."; + /* BITAuthenticatorAuthTypeEmail and BITAuthenticatorAuthTypeEmailAndPassword */ "HockeyAuthenticationViewControllerDataEmailAndPasswordDescription" = "Please enter your HockeyApp account's email address and password to authorize access to this app."; "HockeyAuthenticationViewControllerDataEmailDescription" = "Please enter your HockeyApp account's email address to authorize access to this app."; diff --git a/Resources/es.lproj/HockeySDK.strings b/Resources/es.lproj/HockeySDK.strings index b8b9b28d61..225fc0805a 100644 --- a/Resources/es.lproj/HockeySDK.strings +++ b/Resources/es.lproj/HockeySDK.strings @@ -240,7 +240,7 @@ "HockeyAuthenticatorViewControllerTitle" = "HockeyApp"; /* BITAuthenticatorAuthTypeUDIDProvider */ -"HockeyAuthenticationViewControllerWebLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; +"HockeyAuthenticationViewControllerWebUDIDLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; "HockeyAuthenticationViewControllerWebLoginButtonTitle" = "Open HockeyApp"; /* BITAuthenticatorAuthTypeEmail and BITAuthenticatorAuthTypeEmailAndPassword */ diff --git a/Resources/fr.lproj/HockeySDK.strings b/Resources/fr.lproj/HockeySDK.strings index 2e6da6cf42..39eb633e4b 100644 --- a/Resources/fr.lproj/HockeySDK.strings +++ b/Resources/fr.lproj/HockeySDK.strings @@ -240,7 +240,7 @@ "HockeyAuthenticatorViewControllerTitle" = "HockeyApp"; /* BITAuthenticatorAuthTypeUDIDProvider */ -"HockeyAuthenticationViewControllerWebLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; +"HockeyAuthenticationViewControllerWebUDIDLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; "HockeyAuthenticationViewControllerWebLoginButtonTitle" = "Open HockeyApp"; /* BITAuthenticatorAuthTypeEmail and BITAuthenticatorAuthTypeEmailAndPassword */ diff --git a/Resources/hr.lproj/HockeySDK.strings b/Resources/hr.lproj/HockeySDK.strings index 2b5c09cf2a..cc5ae70b74 100644 --- a/Resources/hr.lproj/HockeySDK.strings +++ b/Resources/hr.lproj/HockeySDK.strings @@ -238,7 +238,7 @@ "HockeyAuthenticatorViewControllerTitle" = "HockeyApp"; /* BITAuthenticatorAuthTypeUDIDProvider */ -"HockeyAuthenticationViewControllerWebLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; +"HockeyAuthenticationViewControllerWebUDIDLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; "HockeyAuthenticationViewControllerWebLoginButtonTitle" = "Open HockeyApp"; /* BITAuthenticatorAuthTypeEmail and BITAuthenticatorAuthTypeEmailAndPassword */ diff --git a/Resources/hu.lproj/HockeySDK.strings b/Resources/hu.lproj/HockeySDK.strings index 17cec77c00..8ef397b63e 100644 --- a/Resources/hu.lproj/HockeySDK.strings +++ b/Resources/hu.lproj/HockeySDK.strings @@ -238,7 +238,7 @@ "HockeyAuthenticatorViewControllerTitle" = "HockeyApp"; /* BITAuthenticatorAuthTypeUDIDProvider */ -"HockeyAuthenticationViewControllerWebLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; +"HockeyAuthenticationViewControllerWebUDIDLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; "HockeyAuthenticationViewControllerWebLoginButtonTitle" = "Open HockeyApp"; /* BITAuthenticatorAuthTypeEmail and BITAuthenticatorAuthTypeEmailAndPassword */ diff --git a/Resources/it.lproj/HockeySDK.strings b/Resources/it.lproj/HockeySDK.strings index fa973d22ff..028466d05f 100644 --- a/Resources/it.lproj/HockeySDK.strings +++ b/Resources/it.lproj/HockeySDK.strings @@ -240,7 +240,7 @@ "HockeyAuthenticatorViewControllerTitle" = "HockeyApp"; /* BITAuthenticatorAuthTypeUDIDProvider */ -"HockeyAuthenticationViewControllerWebLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; +"HockeyAuthenticationViewControllerWebUDIDLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; "HockeyAuthenticationViewControllerWebLoginButtonTitle" = "Open HockeyApp"; /* BITAuthenticatorAuthTypeEmail and BITAuthenticatorAuthTypeEmailAndPassword */ diff --git a/Resources/ja.lproj/HockeySDK.strings b/Resources/ja.lproj/HockeySDK.strings index 63be70b2f5..0d75bc0b20 100644 --- a/Resources/ja.lproj/HockeySDK.strings +++ b/Resources/ja.lproj/HockeySDK.strings @@ -240,7 +240,7 @@ "HockeyAuthenticatorViewControllerTitle" = "HockeyApp"; /* BITAuthenticatorAuthTypeUDIDProvider */ -"HockeyAuthenticationViewControllerWebLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; +"HockeyAuthenticationViewControllerWebUDIDLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; "HockeyAuthenticationViewControllerWebLoginButtonTitle" = "Open HockeyApp"; /* BITAuthenticatorAuthTypeEmail and BITAuthenticatorAuthTypeEmailAndPassword */ diff --git a/Resources/pt-PT.lproj/HockeySDK.strings b/Resources/pt-PT.lproj/HockeySDK.strings index f781928dd0..bb054d367e 100644 --- a/Resources/pt-PT.lproj/HockeySDK.strings +++ b/Resources/pt-PT.lproj/HockeySDK.strings @@ -240,7 +240,7 @@ "HockeyAuthenticatorViewControllerTitle" = "HockeyApp"; /* BITAuthenticatorAuthTypeUDIDProvider */ -"HockeyAuthenticationViewControllerWebLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; +"HockeyAuthenticationViewControllerWebUDIDLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; "HockeyAuthenticationViewControllerWebLoginButtonTitle" = "Open HockeyApp"; /* BITAuthenticatorAuthTypeEmail and BITAuthenticatorAuthTypeEmailAndPassword */ diff --git a/Resources/pt.lproj/HockeySDK.strings b/Resources/pt.lproj/HockeySDK.strings index 42d4a4db53..dc48a8e871 100644 --- a/Resources/pt.lproj/HockeySDK.strings +++ b/Resources/pt.lproj/HockeySDK.strings @@ -240,7 +240,7 @@ "HockeyAuthenticatorViewControllerTitle" = "HockeyApp"; /* BITAuthenticatorAuthTypeUDIDProvider */ -"HockeyAuthenticationViewControllerWebLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; +"HockeyAuthenticationViewControllerWebUDIDLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; "HockeyAuthenticationViewControllerWebLoginButtonTitle" = "Open HockeyApp"; /* BITAuthenticatorAuthTypeEmail and BITAuthenticatorAuthTypeEmailAndPassword */ diff --git a/Resources/ro.lproj/HockeySDK.strings b/Resources/ro.lproj/HockeySDK.strings index 5910e49970..ff5329b655 100755 --- a/Resources/ro.lproj/HockeySDK.strings +++ b/Resources/ro.lproj/HockeySDK.strings @@ -238,7 +238,7 @@ "HockeyAuthenticatorViewControllerTitle" = "HockeyApp"; /* BITAuthenticatorAuthTypeUDIDProvider */ -"HockeyAuthenticationViewControllerWebLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; +"HockeyAuthenticationViewControllerWebUDIDLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; "HockeyAuthenticationViewControllerWebLoginButtonTitle" = "Open HockeyApp"; /* BITAuthenticatorAuthTypeEmail and BITAuthenticatorAuthTypeEmailAndPassword */ diff --git a/Resources/ru.lproj/HockeySDK.strings b/Resources/ru.lproj/HockeySDK.strings index 41f410a673..b43dbba00c 100644 --- a/Resources/ru.lproj/HockeySDK.strings +++ b/Resources/ru.lproj/HockeySDK.strings @@ -240,7 +240,7 @@ "HockeyAuthenticatorViewControllerTitle" = "HockeyApp"; /* BITAuthenticatorAuthTypeUDIDProvider */ -"HockeyAuthenticationViewControllerWebLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; +"HockeyAuthenticationViewControllerWebUDIDLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; "HockeyAuthenticationViewControllerWebLoginButtonTitle" = "Open HockeyApp"; /* BITAuthenticatorAuthTypeEmail and BITAuthenticatorAuthTypeEmailAndPassword */ diff --git a/Resources/zh-Hans.lproj/HockeySDK.strings b/Resources/zh-Hans.lproj/HockeySDK.strings index 7252698953..0e0efc0d59 100644 --- a/Resources/zh-Hans.lproj/HockeySDK.strings +++ b/Resources/zh-Hans.lproj/HockeySDK.strings @@ -240,7 +240,7 @@ "HockeyAuthenticatorViewControllerTitle" = "HockeyApp"; /* BITAuthenticatorAuthTypeUDIDProvider */ -"HockeyAuthenticationViewControllerWebLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; +"HockeyAuthenticationViewControllerWebUDIDLoginDescription" = "The developer has requested this device's UDID. Tap below to open the HockeyApp website and authorize access."; "HockeyAuthenticationViewControllerWebLoginButtonTitle" = "Open HockeyApp"; /* BITAuthenticatorAuthTypeEmail and BITAuthenticatorAuthTypeEmailAndPassword */ diff --git a/Support/HockeySDKTests/BITAuthenticatorTests.m b/Support/HockeySDKTests/BITAuthenticatorTests.m index 30c3f17b25..af68b0c490 100644 --- a/Support/HockeySDKTests/BITAuthenticatorTests.m +++ b/Support/HockeySDKTests/BITAuthenticatorTests.m @@ -111,7 +111,7 @@ static void *kInstallationIdentification = &kInstallationIdentification; assertThatBool(_sut.isValidated, equalToBool(NO)); assertThat(_sut.authenticationSecret, equalTo(nil)); assertThat(_sut.installationIdentifier, equalTo(nil)); - assertThat(_sut.installationIdentifierTypeString, equalTo(@"uuid")); + assertThat(_sut.installationIdentifierParameterString, equalTo(@"uuid")); } #pragma mark - General identification tests @@ -189,6 +189,16 @@ static void *kInstallationIdentification = &kInstallationIdentification; [verifyCount(delegateMock, times(1)) authenticator:_sut willShowAuthenticationController:(id)anything()]; } +#pragma mark - Web auth identification type +- (void) testWebAuthIdentificationShowsViewController { + _sut.identificationType = BITAuthenticatorIdentificationTypeWebAuth; + id delegateMock = mockProtocol(@protocol(BITAuthenticatorDelegate)); + _sut.delegate = delegateMock; + + [_sut identifyWithCompletion:nil]; + + [verifyCount(delegateMock, times(1)) authenticator:_sut willShowAuthenticationController:(id)anything()]; +} #pragma mark - Email identification type - (void) testEmailIdentificationFailsWithMissingSecret {