Skip to content

Commit

Permalink
Merge pull request #209 from ory-am/0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arekkas authored Aug 17, 2016
2 parents cd6daed + b9b755a commit 56d1e58
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,9 @@ hydra

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

<img src="docs/dist/oauth2-flow.gif" alt="OAuth2 Flow">

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

<br clear="all">

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

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

## Reception

Expand Down
10 changes: 10 additions & 0 deletions cmd/server/handler_oauth2_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/ory-am/hydra/pkg"
"golang.org/x/net/context"
r "gopkg.in/dancannon/gorethink.v2"
"github.com/ory-am/hydra/herodot"
)

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

ctx := c.Context()
handler := &oauth2.Handler{
ForcedHTTP: c.ForceHTTP,
OAuth2: o,
Expand All @@ -132,6 +134,14 @@ func newOAuth2Handler(c *config.Config, router *httprouter.Router, km jwk.Manage
DefaultIDTokenLifespan: c.GetIDTokenLifespan(),
},
ConsentURL: *consentURL,
Introspector: &oauth2.LocalIntrospector{
OAuth2: o,
AccessTokenLifespan: c.GetAccessTokenLifespan(),
Issuer : c.Issuer,

},
Firewall: ctx.Warden,
H: &herodot.JSON{},
}

handler.SetRoutes(router)
Expand Down
8 changes: 8 additions & 0 deletions sdk/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/ory-am/hydra/jwk"
"github.com/ory-am/hydra/pkg"
"github.com/ory-am/hydra/policy"
hoauth2 "github.com/ory-am/hydra/oauth2"
"github.com/ory-am/hydra/warden"
"golang.org/x/net/context"
"golang.org/x/oauth2"
Expand Down Expand Up @@ -44,6 +45,8 @@ type Client struct {
// Warden offers Access Token and Access Request validation strategies.
Warden *warden.HTTPWarden

Introspector *hoauth2.HTTPIntrospector

http *http.Client
clusterURL *url.URL
clientID string
Expand Down Expand Up @@ -115,6 +118,11 @@ func Connect(opts ...option) (*Client, error) {
Client: c.http,
}

c.Introspector = &hoauth2.HTTPIntrospector{
Endpoint: pkg.JoinURL(c.clusterURL, hoauth2.IntrospectPath),
Client: c.http,
}

c.JWK = &jwk.HTTPManager{
Endpoint: pkg.JoinURL(c.clusterURL, "/keys"),
Client: c.http,
Expand Down

0 comments on commit 56d1e58

Please sign in to comment.