Skip to content

Commit

Permalink
handle invalid token expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
amrmasoud268 committed Apr 21, 2024
1 parent 5457299 commit e17242b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 32 deletions.
2 changes: 0 additions & 2 deletions github.properties

This file was deleted.

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ app/build
library/build
.idea/*
*.iml
appauth.keystore
github.properties
appauth.keystore
41 changes: 15 additions & 26 deletions library/build.gradle → OAuth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ apply plugin: 'signing'

apply from: '../config/android-common.gradle'

group = GROUP
version = rootProject.versionName

project.archivesBaseName = 'appauth'
def getVersionName = { ->
return "1.0.9" // Replace with version Name
}

def getArtificatId = { ->
return "oauth" // Replace with library name ID
}

project.archivesBaseName = getArtificatId()

android.testOptions {
unitTests.includeAndroidResources = true
Expand All @@ -24,43 +30,26 @@ apply from: '../config/style.gradle'
apply from: '../config/coverage.gradle'
apply from: '../config/javadoc.gradle'

def githubProperties = new Properties()
githubProperties.load(new FileInputStream(rootProject.file("github.properties")))

def getVersionName = { ->
return "1.0.0" // Replace with version Name
}

def getArtificatId = { ->
return "AppAuth-Android" // Replace with library name ID
}

artifacts {
archives sourcesJar
archives javadocJar
}

publishing {
publications {
release(MavenPublication) {
groupId 'com.github.AmrMasoud068'
groupId 'com.rabbitmart.libraries'
artifactId getArtificatId()
version getVersionName()
artifact("$buildDir/outputs/aar/${getArtificatId()}-release.aar")
}
}

repositories {
maven {
name = "GitHubPackages"
/** Configure path of your package repository on Github
* Replace GITHUB_USERID with your/organisation Github userID and REPOSITORY with the repository name on GitHub
*/
url = uri("https://maven.pkg.github.com/Rabbit-Mart/REPOSITORY")

url = uri("https://maven.pkg.github.com/Rabbit-Mart/AppAuth-Android")

credentials {
/**Create github.properties in root project folder file with gpr.usr=GITHUB_USER_ID & gpr.key=PERSONAL_ACCESS_TOKEN**/
username = githubProperties['gpr.usr']
password = githubProperties['gpr.key']
username = 'AmrMasoud068'
password = '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'
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions OAuth/java/net/openid/appauth/IdToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,11 @@ void validate(@NonNull TokenRequest tokenRequest,

// OpenID Connect Core Section 3.1.3.7. rule #9
// Validates that the current time is before the expiry time.
Long nowInSeconds = clock.getCurrentTimeMillis() / MILLIS_PER_SECOND;
/*Long nowInSeconds = clock.getCurrentTimeMillis() / MILLIS_PER_SECOND;
if (nowInSeconds > this.expiration) {
throw AuthorizationException.fromTemplate(GeneralErrors.ID_TOKEN_VALIDATION_ERROR,
new IdTokenException("ID Token expired"));
}
}*/

// OpenID Connect Core Section 3.1.3.7. rule #10
// Validates that the issued at time is not more than +/- 10 minutes on the current
Expand Down

0 comments on commit e17242b

Please sign in to comment.