FRAUriMechanismReader.h revision 7c51d54f23c5581d2cf894f9eafb9798e3febd22
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens Elkner * The contents of this file are subject to the terms of the Common Development and
e6d40133bc9f858308654afb1262b8b483ec5922Till Mossakowski * Distribution License (the License). You may not use this file except in compliance with the
ea9ad77838dce923ced1df2ac09a7f0226363593Christian Maeder * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
3f69b6948966979163bdfe8331c38833d5d90ecdChristian Maeder * specific language governing permission and limitations under the License.
ea9ad77838dce923ced1df2ac09a7f0226363593Christian Maeder * When distributing Covered Software, include this CDDL Header Notice in each file and include
f3a94a197960e548ecd6520bb768cb0d547457bbChristian Maeder * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
e6d40133bc9f858308654afb1262b8b483ec5922Till Mossakowski * Header, with the fields enclosed by brackets [] replaced by your own identifying
93fa7e4374de6e37328e752991a698bf03032c75Christian Maeder * information: "Portions copyright [year] [name of copyright owner]".
e849958012c0bd2bfa751f6ec264b3ecb680c00aChristian Maeder * Copyright 2016 ForgeRock AS.
5e605dc61ff9ec5724c319603905dc9b0dccc05fChristian Maeder * This Authenticator Application makes use of the existing OATH
64c3ee43f3cbacbeffb633103ffe6269f2177485Christian Maeder * URL scheme for encoding Identity and Mechanism information.
ccd28c25c1aee73a195053e677eca17e20917d84Christian Maeder * This is defined in detail here:
5cc369fbceee1b13bd0f06e43620c46541d1d4f8Christian Maeder * https://github.com/google/google-authenticator/wiki/Key-Uri-Format
5cc369fbceee1b13bd0f06e43620c46541d1d4f8Christian Maeder * This factory will also be able to parse a similar URL scheme
5cc369fbceee1b13bd0f06e43620c46541d1d4f8Christian Maeder * Push Authentication when it is supported by this Application.
2eb84fc82d3ffa9116bc471fda3742bd9e5a24bbChristian Maeder * Note: Only responsible for generating the instances of Identity and
2eb84fc82d3ffa9116bc471fda3742bd9e5a24bbChristian Maeder * Mechanism. Will not be responsible for database persistence.
e849958012c0bd2bfa751f6ec264b3ecb680c00aChristian Maeder * Init method.
782d5365e084a40e4f717dafbe00fc41476a7cfeChristian Maeder * @param database The database to which this object can be persisted.
782d5365e084a40e4f717dafbe00fc41476a7cfeChristian Maeder * @return The initialized object or nil if initialization failed.
782d5365e084a40e4f717dafbe00fc41476a7cfeChristian Maeder- (instancetype)initWithDatabase:(FRAIdentityDatabase *)database identityModel:(FRAIdentityModel *)identityModel;
5e605dc61ff9ec5724c319603905dc9b0dccc05fChristian Maeder * Adds a mechanism factory to this Mechanism Readert.
e849958012c0bd2bfa751f6ec264b3ecb680c00aChristian Maeder * The added mechanism Factory adds the capability to decode a new type of message.
e849958012c0bd2bfa751f6ec264b3ecb680c00aChristian Maeder * @param factory The FRAMechanismFactory to add to this reader.
782d5365e084a40e4f717dafbe00fc41476a7cfeChristian Maeder- (void)addMechanismFactory:(id<FRAMechanismFactory>)factory;
5e605dc61ff9ec5724c319603905dc9b0dccc05fChristian Maeder * Given a URL, convert this into a FRAMechanism, complete with associated Identity.
5cc369fbceee1b13bd0f06e43620c46541d1d4f8Christian Maeder * @param url The URL to parse, non-nil.
5cc369fbceee1b13bd0f06e43620c46541d1d4f8Christian Maeder * @param handler The block to invoke when asynchronous operation is completed.
5cc369fbceee1b13bd0f06e43620c46541d1d4f8Christian Maeder * @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.
5cc369fbceee1b13bd0f06e43620c46541d1d4f8Christian Maeder * @return non nil FRAMechanism initialsed with the values present in the URL.
5e605dc61ff9ec5724c319603905dc9b0dccc05fChristian Maeder- (FRAMechanism*)parseFromURL:(NSURL*)url handler:(void(^)(BOOL, NSError *))handler error:(NSError *__autoreleasing *)error;
5e605dc61ff9ec5724c319603905dc9b0dccc05fChristian Maeder * Convenience function which will call parseFromURL.
5e605dc61ff9ec5724c319603905dc9b0dccc05fChristian Maeder * @param string the String uri to parse a mechanism from.
5cc369fbceee1b13bd0f06e43620c46541d1d4f8Christian Maeder * @param handler The block to invoke when asynchronous operation is completed.
5cc369fbceee1b13bd0f06e43620c46541d1d4f8Christian Maeder * @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.
5cc369fbceee1b13bd0f06e43620c46541d1d4f8Christian Maeder * @return the FRAMechanism object extracted from the string.