Skip to content

Commit

Permalink
Merge d06cdf0 into 0aefa72
Browse files Browse the repository at this point in the history
  • Loading branch information
sgal authored Mar 24, 2023
2 parents 0aefa72 + d06cdf0 commit 4b341d8
Show file tree
Hide file tree
Showing 20 changed files with 1,284 additions and 231 deletions.
9 changes: 5 additions & 4 deletions driver/config/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const (
KeyOAuth2GrantJWTIssuedDateOptional = "oauth2.grant.jwt.iat_optional"
KeyOAuth2GrantJWTMaxDuration = "oauth2.grant.jwt.max_ttl"
KeyRefreshTokenHookURL = "oauth2.refresh_token_hook" // #nosec G101
KeyTokenHookURL = "oauth2.token_hook" // #nosec G101
KeyDevelopmentMode = "dev"
)

Expand Down Expand Up @@ -420,11 +421,11 @@ func (p *DefaultProvider) AccessTokenStrategy(ctx context.Context, additionalSou
return s
}

func (p *DefaultProvider) TokenRefreshHookURL(ctx context.Context) *url.URL {
if len(p.getProvider(ctx).String(KeyRefreshTokenHookURL)) == 0 {
return nil
}
func (p *DefaultProvider) TokenHookURL(ctx context.Context) *url.URL {
return p.getProvider(ctx).RequestURIF(KeyTokenHookURL, nil)
}

func (p *DefaultProvider) TokenRefreshHookURL(ctx context.Context) *url.URL {
return p.getProvider(ctx).RequestURIF(KeyRefreshTokenHookURL, nil)
}

Expand Down
1 change: 1 addition & 0 deletions driver/registry_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ func (m *RegistryBase) AccessRequestHooks() []oauth2.AccessRequestHook {
if m.arhs == nil {
m.arhs = []oauth2.AccessRequestHook{
oauth2.RefreshTokenHook(m),
oauth2.TokenHook(m),
}
}
return m.arhs
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": "",
"ext": {
"hooked": "legacy"
}
},
"headers": {
"extra": {
}
},
"username": "",
"subject": "foo"
},
"extra": {
"hooked": "legacy"
},
"client_id": "app-client",
"consent_challenge": "",
"exclude_not_before_claim": false,
"allowed_top_level_claims": []
},
"request": {
"client_id": "app-client",
"granted_scopes": [
"offline",
"openid",
"hydra.*"
],
"granted_audience": [],
"grant_types": [
"refresh_token"
],
"payload": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": "",
"ext": {
"hooked": "legacy"
}
},
"headers": {
"extra": {
}
},
"username": "",
"subject": "foo"
},
"extra": {
"hooked": "legacy"
},
"client_id": "app-client",
"consent_challenge": "",
"exclude_not_before_claim": false,
"allowed_top_level_claims": []
},
"request": {
"client_id": "app-client",
"granted_scopes": [
"offline",
"openid",
"hydra.*"
],
"granted_audience": [],
"grant_types": [
"refresh_token"
],
"payload": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": "",
"ext": {
"hooked": "legacy"
}
},
"headers": {
"extra": {
}
},
"username": "",
"subject": "foo"
},
"extra": {
"hooked": "legacy"
},
"client_id": "app-client",
"consent_challenge": "",
"exclude_not_before_claim": false,
"allowed_top_level_claims": []
},
"request": {
"client_id": "app-client",
"granted_scopes": [
"offline",
"openid",
"hydra.*"
],
"granted_audience": [],
"grant_types": [
"refresh_token"
],
"payload": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": "",
"ext": {
"hooked": "legacy"
}
},
"headers": {
"extra": {
}
},
"username": "",
"subject": "foo"
},
"extra": {
"hooked": "legacy"
},
"client_id": "app-client",
"consent_challenge": "",
"exclude_not_before_claim": false,
"allowed_top_level_claims": []
},
"request": {
"client_id": "app-client",
"granted_scopes": [
"offline",
"openid",
"hydra.*"
],
"granted_audience": [],
"grant_types": [
"refresh_token"
],
"payload": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": "",
"ext": {
"hooked": "legacy"
}
},
"headers": {
"extra": {
}
},
"username": "",
"subject": "foo"
},
"extra": {
"hooked": "legacy"
},
"client_id": "app-client",
"consent_challenge": "",
"exclude_not_before_claim": false,
"allowed_top_level_claims": []
},
"request": {
"client_id": "app-client",
"granted_scopes": [
"offline",
"openid",
"hydra.*"
],
"granted_audience": [],
"grant_types": [
"refresh_token"
],
"payload": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": "",
"ext": {
"hooked": "legacy"
}
},
"headers": {
"extra": {
}
},
"username": "",
"subject": "foo"
},
"extra": {
"hooked": "legacy"
},
"client_id": "app-client",
"consent_challenge": "",
"exclude_not_before_claim": false,
"allowed_top_level_claims": []
},
"request": {
"client_id": "app-client",
"granted_scopes": [
"offline",
"openid",
"hydra.*"
],
"granted_audience": [],
"grant_types": [
"refresh_token"
],
"payload": {}
}
}
Loading

0 comments on commit 4b341d8

Please sign in to comment.