-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #751 from Iterable/feature/JWTImprovement
[MOB - 8993] - JWT part 2 with improvements
- Loading branch information
Showing
6 changed files
with
96 additions
and
9 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
iterableapi/src/main/java/com/iterable/iterableapi/AuthFailure.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.iterable.iterableapi; | ||
|
||
/** | ||
* Represents an auth failure object. | ||
*/ | ||
public class AuthFailure { | ||
|
||
/** userId or email of the signed-in user */ | ||
public final String userKey; | ||
|
||
/** the authToken which caused the failure */ | ||
public final String failedAuthToken; | ||
|
||
/** the timestamp of the failed request */ | ||
public final long failedRequestTime; | ||
|
||
/** indicates a reason for failure */ | ||
public final AuthFailureReason failureReason; | ||
|
||
public AuthFailure(String userKey, | ||
String failedAuthToken, | ||
long failedRequestTime, | ||
AuthFailureReason failureReason) { | ||
this.userKey = userKey; | ||
this.failedAuthToken = failedAuthToken; | ||
this.failedRequestTime = failedRequestTime; | ||
this.failureReason = failureReason; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
iterableapi/src/main/java/com/iterable/iterableapi/AuthFailureReason.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.iterable.iterableapi; | ||
public enum AuthFailureReason { | ||
AUTH_TOKEN_EXPIRED, | ||
AUTH_TOKEN_GENERIC_ERROR, | ||
AUTH_TOKEN_EXPIRATION_INVALID, | ||
AUTH_TOKEN_SIGNATURE_INVALID, | ||
AUTH_TOKEN_FORMAT_INVALID, | ||
AUTH_TOKEN_INVALIDATED, | ||
AUTH_TOKEN_PAYLOAD_INVALID, | ||
AUTH_TOKEN_USER_KEY_INVALID, | ||
AUTH_TOKEN_NULL, | ||
AUTH_TOKEN_GENERATION_ERROR, | ||
AUTH_TOKEN_MISSING, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters