Skip to content

Commit 56d1e58

Browse files
authored
Merge pull request #209 from ory-am/0.4.0
2 parents cd6daed + b9b755a commit 56d1e58

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,9 @@ hydra
147147

148148
The **[tutorial](https://ory-am.gitbooks.io/hydra/content/demo.md)** teaches you to set up Hydra,
149149
a RethinkDB instance and an exemplary identity provider written in React using docker compose.
150-
It will take you about 5 minutes to get complete the **[tutorial](https://ory-am.gitbooks.io/hydra/content/demo.md)**.
150+
It will take you about 5 minutes to get complete the **[tutorial](https://ory-am.gitbooks.io/hydra/content/demo.html)**.
151151

152-
<img src="docs/dist/oauth2-flow.gif" alt="OAuth2 Flow">
153-
154-
<img alt="Running the example" align="right" width="35%" src="docs/dist/run-the-example.gif">
152+
<img src="docs/dist/images/oauth2-flow.gif" alt="OAuth2 Flow">
155153

156154
<br clear="all">
157155

@@ -163,7 +161,7 @@ OAuth2 and OAuth2 related specifications are over 200 written pages. Implementin
163161
Even if you use a secure SDK (there are numerous SDKs not secure by design in the wild), messing up the implementation
164162
is a real threat - no matter how good you or your team is. To err is human.
165163

166-
An in-depth list of security features is listed [in the security guide]().
164+
An in-depth list of security features is listed [in the security guide](https://ory-am.gitbooks.io/hydra/content/basics/security.html).
167165

168166
## Reception
169167

cmd/server/handler_oauth2_factory.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"github.com/ory-am/hydra/pkg"
1818
"golang.org/x/net/context"
1919
r "gopkg.in/dancannon/gorethink.v2"
20+
"github.com/ory-am/hydra/herodot"
2021
)
2122

2223
func injectFositeStore(c *config.Config, clients client.Manager) {
@@ -122,6 +123,7 @@ func newOAuth2Handler(c *config.Config, router *httprouter.Router, km jwk.Manage
122123
consentURL, err := url.Parse(c.ConsentURL)
123124
pkg.Must(err, "Could not parse consent url %s.", c.ConsentURL)
124125

126+
ctx := c.Context()
125127
handler := &oauth2.Handler{
126128
ForcedHTTP: c.ForceHTTP,
127129
OAuth2: o,
@@ -132,6 +134,14 @@ func newOAuth2Handler(c *config.Config, router *httprouter.Router, km jwk.Manage
132134
DefaultIDTokenLifespan: c.GetIDTokenLifespan(),
133135
},
134136
ConsentURL: *consentURL,
137+
Introspector: &oauth2.LocalIntrospector{
138+
OAuth2: o,
139+
AccessTokenLifespan: c.GetAccessTokenLifespan(),
140+
Issuer : c.Issuer,
141+
142+
},
143+
Firewall: ctx.Warden,
144+
H: &herodot.JSON{},
135145
}
136146

137147
handler.SetRoutes(router)

sdk/client.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/ory-am/hydra/jwk"
1212
"github.com/ory-am/hydra/pkg"
1313
"github.com/ory-am/hydra/policy"
14+
hoauth2 "github.com/ory-am/hydra/oauth2"
1415
"github.com/ory-am/hydra/warden"
1516
"golang.org/x/net/context"
1617
"golang.org/x/oauth2"
@@ -44,6 +45,8 @@ type Client struct {
4445
// Warden offers Access Token and Access Request validation strategies.
4546
Warden *warden.HTTPWarden
4647

48+
Introspector *hoauth2.HTTPIntrospector
49+
4750
http *http.Client
4851
clusterURL *url.URL
4952
clientID string
@@ -115,6 +118,11 @@ func Connect(opts ...option) (*Client, error) {
115118
Client: c.http,
116119
}
117120

121+
c.Introspector = &hoauth2.HTTPIntrospector{
122+
Endpoint: pkg.JoinURL(c.clusterURL, hoauth2.IntrospectPath),
123+
Client: c.http,
124+
}
125+
118126
c.JWK = &jwk.HTTPManager{
119127
Endpoint: pkg.JoinURL(c.clusterURL, "/keys"),
120128
Client: c.http,

0 commit comments

Comments
 (0)