-
Notifications
You must be signed in to change notification settings - Fork 7
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 #808 from navikt/deprecate
deprecate OAuth2GrantType
- Loading branch information
Showing
23 changed files
with
111 additions
and
124 deletions.
There are no files selected for viewing
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
14 changes: 10 additions & 4 deletions
14
...-client-core/src/main/kotlin/no/nav/security/token/support/client/core/OAuth2GrantType.kt
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 |
---|---|---|
@@ -1,14 +1,20 @@ | ||
package no.nav.security.token.support.client.core | ||
|
||
data class OAuth2GrantType(@JvmField val value : String) { | ||
import com.nimbusds.oauth2.sdk.GrantType | ||
|
||
@Deprecated("Use GrantType from nimbus instead", ReplaceWith("GrantType"), DeprecationLevel.WARNING) | ||
data class OAuth2GrantType(@JvmField val value : String) { | ||
fun value() = value | ||
|
||
companion object { | ||
@JvmField | ||
val JWT_BEARER = OAuth2GrantType("urn:ietf:params:oauth:grant-type:jwt-bearer") | ||
@Deprecated("Use GrantType.JWT_BEARER from nimbus instead") | ||
val JWT_BEARER = OAuth2GrantType(GrantType.JWT_BEARER.value) | ||
@JvmField | ||
val CLIENT_CREDENTIALS = OAuth2GrantType("client_credentials") | ||
@Deprecated("Use GrantType.CLIENT_CREDENTIALS from nimbus instead") | ||
val CLIENT_CREDENTIALS = OAuth2GrantType(GrantType.CLIENT_CREDENTIALS.value) | ||
@JvmField | ||
val TOKEN_EXCHANGE = OAuth2GrantType("urn:ietf:params:oauth:grant-type:token-exchange") | ||
@Deprecated("Use GrantType.TOKEN_EXCHANGE from nimbus instead") | ||
val TOKEN_EXCHANGE = OAuth2GrantType(GrantType.TOKEN_EXCHANGE.value) | ||
} | ||
} |
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
4 changes: 2 additions & 2 deletions
4
...ain/kotlin/no/nav/security/token/support/client/core/oauth2/AbstractOAuth2GrantRequest.kt
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
4 changes: 2 additions & 2 deletions
4
.../kotlin/no/nav/security/token/support/client/core/oauth2/ClientCredentialsGrantRequest.kt
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package no.nav.security.token.support.client.core.oauth2 | ||
|
||
import com.nimbusds.oauth2.sdk.GrantType | ||
import no.nav.security.token.support.client.core.ClientProperties | ||
import no.nav.security.token.support.client.core.OAuth2GrantType.Companion.CLIENT_CREDENTIALS | ||
|
||
class ClientCredentialsGrantRequest(clientProperties : ClientProperties) : AbstractOAuth2GrantRequest(CLIENT_CREDENTIALS, clientProperties) | ||
class ClientCredentialsGrantRequest(clientProperties : ClientProperties) : AbstractOAuth2GrantRequest(GrantType.CLIENT_CREDENTIALS, clientProperties) |
6 changes: 3 additions & 3 deletions
6
...main/kotlin/no/nav/security/token/support/client/core/oauth2/OAuth2AccessTokenResponse.kt
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package no.nav.security.token.support.client.core.oauth2 | ||
|
||
data class OAuth2AccessTokenResponse (var access_token : String? = null, var expires_at : Int? = null, var expires_in : Int? = 60, private val additionalParameters : Map<String, Any> = emptyMap()) { | ||
val accessToken = access_token | ||
val expiresAt = expires_at | ||
val expiresIn = expires_in | ||
val accessToken get() = access_token | ||
val expiresAt get() = expires_at | ||
val expiresIn get() = expires_in | ||
} |
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
5 changes: 2 additions & 3 deletions
5
...rc/main/kotlin/no/nav/security/token/support/client/core/oauth2/OnBehalfOfGrantRequest.kt
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
4 changes: 2 additions & 2 deletions
4
...main/kotlin/no/nav/security/token/support/client/core/oauth2/TokenExchangeGrantRequest.kt
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
Oops, something went wrong.