-
-
Notifications
You must be signed in to change notification settings - Fork 935
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This feature allows Ory Kratos to act as a login provider for Ory Hydra using the `oauth2_provider.url` configuration value. Closes #273 Closes #2293 See ory/kratos-selfservice-ui-node#50 See ory/kratos-selfservice-ui-node#68 See ory/kratos-selfservice-ui-node#108 See ory/kratos-selfservice-ui-node#111 See ory/kratos-selfservice-ui-node#149 See ory/kratos-selfservice-ui-node#170 See ory/kratos-selfservice-ui-node#198 See ory/kratos-selfservice-ui-node#207
- Loading branch information
Showing
118 changed files
with
9,503 additions
and
653 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
- op: replace | ||
path: "#/components/schemas/NullUUID" | ||
value: | ||
type: string | ||
format: uuid4 | ||
nullable: true | ||
- op: replace | ||
path: "#/components/schemas/NullTime" | ||
value: | ||
format: date-time | ||
type: string | ||
nullable: true | ||
- op: replace | ||
path: "#/components/schemas/Time" | ||
value: | ||
format: date-time | ||
type: string | ||
- op: replace | ||
path: "#/components/schemas/NullString" | ||
value: | ||
type: string | ||
nullable: true | ||
- op: replace | ||
path: "#/components/schemas/NullBool" | ||
value: | ||
type: boolean | ||
nullable: true | ||
- op: replace | ||
path: "#/components/schemas/NullInt" | ||
value: | ||
type: integer | ||
nullable: true | ||
- op: replace | ||
path: "#/components/schemas/nullInt64" | ||
value: | ||
type: integer | ||
nullable: true | ||
- op: replace | ||
path: "#/components/schemas/nullDuration" | ||
value: | ||
type: string | ||
nullable: true | ||
pattern: ^[0-9]+(ns|us|ms|s|m|h)$ |
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
oauth2_provider: | ||
url: https://oauth2_provider/ | ||
headers: | ||
Authorization: Basic |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package hydra | ||
|
||
import ( | ||
"context" | ||
"errors" | ||
|
||
"github.com/gofrs/uuid" | ||
|
||
hydraclientgo "github.com/ory/hydra-client-go" | ||
"github.com/ory/kratos/session" | ||
) | ||
|
||
const ( | ||
FAKE_GET_LOGIN_REQUEST_RETURN_NIL_NIL = "b805f2d9-2f6d-4745-9d68-a17f48e25774" | ||
FAKE_ACCEPT_REQUEST_FAIL = "2e98454e-031b-4870-9ad6-8517df1ce604" | ||
FAKE_SUCCESS = "5ff59a39-ecc5-467e-bb10-26644c0700ee" | ||
) | ||
|
||
type FakeHydra struct{} | ||
|
||
var _ Hydra = &FakeHydra{} | ||
|
||
func NewFakeHydra() *FakeHydra { | ||
return &FakeHydra{} | ||
} | ||
|
||
func (h *FakeHydra) AcceptLoginRequest(ctx context.Context, hlc uuid.UUID, sub string, amr session.AuthenticationMethods) (string, error) { | ||
switch hlc.String() { | ||
case FAKE_ACCEPT_REQUEST_FAIL: | ||
return "", errors.New("failed to accept login request") | ||
default: | ||
panic("unknown fake login_challenge " + hlc.String()) | ||
} | ||
} | ||
|
||
func (h *FakeHydra) GetLoginRequest(ctx context.Context, hlc uuid.NullUUID) (*hydraclientgo.LoginRequest, error) { | ||
switch hlc.UUID.String() { | ||
case FAKE_ACCEPT_REQUEST_FAIL: | ||
return &hydraclientgo.LoginRequest{}, nil | ||
case FAKE_SUCCESS: | ||
return &hydraclientgo.LoginRequest{}, nil | ||
default: | ||
panic("unknown fake login_challenge " + hlc.UUID.String()) | ||
} | ||
} |
Oops, something went wrong.