-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cucumber test for AuthnOIDC with Identity
- Loading branch information
1 parent
40401f4
commit 5496154
Showing
7 changed files
with
217 additions
and
2 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
51 changes: 51 additions & 0 deletions
51
cucumber/authenticators_oidc/features/authn_oidc_identity.feature
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,51 @@ | ||
@authenticators_oidc | ||
Feature: OIDC Authenticator V2 - Users can authenticate with Identity using OIDC | ||
|
||
Background: | ||
Given the following environment variables are available: | ||
| context_variable | environment_variable | default_value | | ||
| oidc_provider_uri | IDENTITY_PROVIDER_URI | | | ||
| oidc_client_id | IDENTITY_CLIENT_ID | | | ||
| oidc_client_secret | IDENTITY_CLIENT_SECRET | | | ||
| oidc_redirect_url | IDENTITY_REDIRECT | http://localhost:3000/authn-oidc/identity/cucumber/authenticate | | ||
| oidc_username | IDENTITY_USERNAME | | | ||
| oidc_password | IDENTITY_PASSWORD | | | ||
|
||
And I load a policy and enable an oidc user into group "conjur/authn-oidc/identity/users": | ||
""" | ||
- !policy | ||
id: conjur/authn-oidc/identity | ||
body: | ||
- !webservice | ||
annotations: | ||
description: Authentication service for Identity, based on Open ID Connect. | ||
- !variable provider-uri | ||
- !variable client-id | ||
- !variable client-secret | ||
- !variable claim-mapping | ||
- !variable state | ||
- !variable nonce | ||
- !variable redirect-uri | ||
- !group users | ||
- !permit | ||
role: !group users | ||
privilege: [ read, authenticate ] | ||
resource: !webservice | ||
""" | ||
And I set the following conjur variables: | ||
| variable_id | context_variable | default_value | | ||
| conjur/authn-oidc/identity/provider-uri | oidc_provider_uri | | | ||
| conjur/authn-oidc/identity/client-id | oidc_client_id | | | ||
| conjur/authn-oidc/identity/client-secret | oidc_client_secret | | | ||
| conjur/authn-oidc/identity/claim-mapping | | preferred_username | | ||
| conjur/authn-oidc/identity/redirect-uri | oidc_redirect_url | | | ||
|
||
@smoke | ||
Scenario: Authenticating with Conjur using Identity | ||
Given I retrieve OIDC configuration from the provider endpoint for "identity" | ||
And I authenticate and fetch a code from Identity | ||
When I authenticate via OIDC with code and service_id "identity" | ||
Then the OIDC user has been authorized by conjur |
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