Skip to content
This repository was archived by the owner on Dec 12, 2018. It is now read-only.

Commit 499553e

Browse files
committed
Updated javadocs and licenses per @mrioan
1 parent 9fd6639 commit 499553e

File tree

5 files changed

+44
-6
lines changed

5 files changed

+44
-6
lines changed

api/src/main/java/com/stormpath/sdk/challenge/google/GoogleAuthenticatorCreateChallengeRequest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Stormpath, Inc.
2+
* Copyright 2017 Stormpath, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,4 +17,11 @@
1717

1818
import com.stormpath.sdk.challenge.CreateChallengeRequest;
1919

20+
/**
21+
* A Google Authenticator specific create challenge request
22+
*
23+
* Google Authenticator challenges can validate a code at the same time that the challenge is created.
24+
*
25+
* @since 1.4.0
26+
*/
2027
public interface GoogleAuthenticatorCreateChallengeRequest extends CreateChallengeRequest {}

api/src/main/java/com/stormpath/sdk/challenge/google/GoogleAuthenticatorCreateChallengeRequestBuilder.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Stormpath, Inc.
2+
* Copyright 2017 Stormpath, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,7 +17,19 @@
1717

1818
import com.stormpath.sdk.challenge.CreateChallengeRequestBuilder;
1919

20+
/**
21+
* A builder to construct {@link GoogleAuthenticatorCreateChallengeRequest}s Google Authenticator specific create challenge requests.
22+
*
23+
* Google Authenticator can both create the challenge and set the code in one API call.
24+
* See {@link com.stormpath.sdk.factor.google.GoogleAuthenticatorFactor}
25+
*
26+
* @since 1.4.0
27+
*/
2028
public interface GoogleAuthenticatorCreateChallengeRequestBuilder extends CreateChallengeRequestBuilder<GoogleAuthenticatorChallenge> {
2129

30+
/**
31+
* @param code to be used to validate the challenge for the {@link com.stormpath.sdk.factor.google.GoogleAuthenticatorFactor}
32+
* @return GoogleAuthenticatorCreateChallengeRequestBuilder for method chaining with the builder pattern
33+
*/
2234
GoogleAuthenticatorCreateChallengeRequestBuilder withCode(String code);
2335
}

api/src/main/java/com/stormpath/sdk/factor/google/GoogleAuthenticatorFactor.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,21 @@
2222
* A {@code GoogleAuthenticatorFactor} is a Factor that represents a two-step verification services using
2323
* the Time-based One-time Password Algorithm (TOTP) and HMAC-based One-time Password Algorithm (HOTP),
2424
* for authenticating users of mobile applications by Google.
25-
* When issuing a challenge via an GoogleAuthenticatorFactor, a code is sent to the Google Authenticator app,
26-
* and the user can enter the received code back into the system to verify/complete the challenge.
25+
* <p/>
26+
* The TOTP algorithm determines the next valid code without the requirement for any communication between server and
27+
* TOTP client.
28+
* <p/>
29+
* As such, the challenge can be created with the code at the same time:
30+
* <p/>
31+
* <pre>
32+
* GoogleAuthenticatorChallenge challenge = client.instantiate(GoogleAuthenticatorChallenge.class);
33+
* challenge = (GoogleAuthenticatorChallenge) googleAuthenticatorFactor.createChallenge(
34+
* Challenges.GOOGLE_AUTHENTICATOR
35+
* .newCreateRequestFor(challenge)
36+
* <b>.withCode(code)</b>
37+
* .build()
38+
* );
39+
* </pre>
2740
*
2841
* @since 1.1.0
2942
*/

impl/src/main/java/com/stormpath/sdk/impl/challenge/google/DefaultGoogleAuthenticatorCreateChallengeRequest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Stormpath, Inc.
2+
* Copyright 2017 Stormpath, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,6 +20,9 @@
2020
import com.stormpath.sdk.challenge.google.GoogleAuthenticatorCreateChallengeRequest;
2121
import com.stormpath.sdk.impl.challenge.DefaultCreateChallengeRequest;
2222

23+
/**
24+
* @since 1.4.0
25+
*/
2326
public class DefaultGoogleAuthenticatorCreateChallengeRequest extends DefaultCreateChallengeRequest implements GoogleAuthenticatorCreateChallengeRequest {
2427

2528
public DefaultGoogleAuthenticatorCreateChallengeRequest(Challenge challenge, ChallengeOptions options) {

impl/src/main/java/com/stormpath/sdk/impl/challenge/google/DefaultGoogleAuthenticatorCreateChallengeRequestBuilder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Stormpath, Inc.
2+
* Copyright 2017 Stormpath, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,6 +20,9 @@
2020
import com.stormpath.sdk.challenge.google.GoogleAuthenticatorCreateChallengeRequestBuilder;
2121
import com.stormpath.sdk.impl.challenge.DefaultCreateChallengeRequestBuilder;
2222

23+
/**
24+
* @since 1.4.0
25+
*/
2326
public class DefaultGoogleAuthenticatorCreateChallengeRequestBuilder extends DefaultCreateChallengeRequestBuilder<GoogleAuthenticatorChallenge> implements GoogleAuthenticatorCreateChallengeRequestBuilder {
2427

2528
public DefaultGoogleAuthenticatorCreateChallengeRequestBuilder(GoogleAuthenticatorChallenge challenge) {

0 commit comments

Comments
 (0)