FRAUriMechanismReaderTests.m revision 7c51d54f23c5581d2cf894f9eafb9798e3febd22
2N/A * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
2N/A * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
#import <XCTest/XCTest.h>
#import <OCMock/OCMock.h>
@end
- (void)setUp {
[super setUp];
FRAPushMechanismFactory *pushMechanismFactory = [[FRAPushMechanismFactory alloc] initWithGateway:mockGateway];
- (void)tearDown {
[super tearDown];
- (void)testReaderCanParsePushMechanism {
NSURL *qrUrl = [NSURL URLWithString:@"pushauth://push/forgerock:demo3?a=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249YXV0aGVudGljYXRl&image=aHR0cDovL3NlYXR0bGV3cml0ZXIuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDEzLzAxL3dlaWdodC13YXRjaGVycy1zbWFsbC5naWY&b=ff00ff&r=aHR0cDovL2FtcWEtY2xvbmU2OS50ZXN0LmZvcmdlcm9jay5jb206ODA4MC9vcGVuYW0vanNvbi9wdXNoL3Nucy9tZXNzYWdlP19hY3Rpb249cmVnaXN0ZXI&s=dA18Iph3slIUDVuRc5+3y7nv9NLGnPksH66d3jIF6uE=&c=Yf66ojm3Pm80PVvNpljTB6X9CUhgSJ0WZUzB4su3vCY=&l=YW1sYmNvb2tpZT0wMT1hbWxiY29va2ll&m=9326d19c-4d08-4538-8151-f8558e71475f1464361288472&issuer=Rm9yZ2Vyb2Nr"];
FRAPushMechanism *mechanism = (FRAPushMechanism *)[reader parseFromURL:qrUrl handler:nil error:nil];
- (void)testReaderCanParseHotpOathMechanism {
NSURL *qrUrl = [NSURL URLWithString:@"otpauth://hotp/Forgerock:demo?secret=IJQWIZ3FOIQUEYLE&issuer=Forgerock&counter=0"];
FRAHotpOathMechanism *mechanism = (FRAHotpOathMechanism *)[reader parseFromURL:qrUrl handler:nil error:nil];
- (void)testReaderCanParseTotpOathMechanism {
NSURL *qrUrl = [NSURL URLWithString:@"otpauth://totp/ForgeRock:demo?secret=EE3PFF5BM6GHVRNZIBBQWBNRLQ======&issuer=ForgeRock&digits=8&period=30"];
FRATotpOathMechanism *mechanism = (FRATotpOathMechanism *)[reader parseFromURL:qrUrl handler:nil error:nil];
@end