fresh-tomato-92389
06/25/2025, 12:24 PMbrief-egg-61061
06/25/2025, 12:24 PMbrief-egg-61061
06/25/2025, 12:25 PMsh helm repo add ory <https://k8s.ory.sh/helm/charts> helm repo update
[Ory Hydra Kubernetes Helm Chart](https://www.ory.sh/docs/hydra/self-hosted/kubernetes-helm-chart) ### 2. Create a Namespace sh kubectl create namespace ory
[Ory Kratos Enterprise License Kubernetes Quickstart](https://www.ory.sh/docs/self-hosted/oel/quickstart#kubernetes) ### 3. Prepare Secrets You’ll need to create Kubernetes secrets for database connection strings (DSN) and cryptographic secrets. For example, for Ory Hydra: yaml apiVersion: v1 kind: Secret metadata: name: ory-hydra-secret namespace: ory data: dsn: <base64-encoded-dsn> secretsCookie: <base64-encoded-cookie-secret> secretsSystem: <base64-encoded-system-secret>
[Ory Hydra Kubernetes Helm Chart](https://www.ory.sh/docs/hydra/self-hosted/kubernetes-helm-chart) ### 4. Configure and Install Ory Services Create a values.yaml
file to customize your deployment (e.g., set image, secrets, and configuration). Then install Ory Hydra (OAuth2/OIDC provider): sh helm install ory-hydra ory/hydra --namespace ory -f values.yaml
[Ory Kratos Enterprise License Kubernetes Quickstart](https://www.ory.sh/docs/self-hosted/oel/quickstart#kubernetes) For Ory Kratos (identity management), follow a similar process with its Helm chart. ### 5. (Optional) Deploy Example Login & Consent App For OAuth2 flows, you’ll need a login and consent app. Ory provides an example you can deploy: sh helm install hydra-example-idp ory/example-idp \ --set 'hydraAdminUrl=<http://hydra-example-admin/>' \ --set 'hydraPublicUrl=<http://public.hydra.localhost/>' \ --set 'ingress.enabled=true'
[Exemplary login and consent app](https://www.ory.sh/docs/hydra/self-hosted/kubernetes-helm-chart#exemplary-login-and-consent-app) ### 6. Configure Ingress and DNS Set up ingress controllers and update your /etc/hosts
file to route local hostnames to your Minikube or cluster IPs as needed. ### 7. Next Steps - For Ory Kratos, see the [identities quickstart guides](https://www.ory.sh/docs/getting-started/overview) for more details. - For Ory Hydra, follow the [self-hosted quickstart](https://www.ory.sh/docs/hydra/self-hosted/quickstart) for OAuth2/OIDC setup. - For managed Ory Network, you can use the Ory CLI and follow the [Ory Network OAuth2 quickstart](https://www.ory.sh/docs/getting-started/ory-network-oauth2). If you need more help, check out the [Ory Community Chat](https://slack.ory.sh/) or [GitHub discussions](https://github.com/discussions?discussions_q=org%3Aory+sort%3Aupdated-desc) for support. > Note: The knowledge sources provide detailed steps for Ory Hydra and some for Ory Kratos. If you need a full end-to-end example for both, refer to the official documentation for each component as linked above.fresh-tomato-92389
06/25/2025, 12:28 PMbrief-egg-61061
06/25/2025, 12:28 PMbrief-egg-61061
06/25/2025, 12:29 PMjwt
authenticator in Oathkeeper to accept tokens from your IdPs by specifying: - The JWKS (JSON Web Key Set) URLs for public key verification. - Trusted issuers (the iss
claim in the JWT). - Allowed algorithms, required scopes, and target audiences. Example configuration snippet: yaml authenticators: jwt: enabled: true config: jwks_urls: - <https://your-okta-domain.com/oauth2/default/v1/keys> - <https://your-custom-issuer.com/.well-known/jwks.json> trusted_issuers: - <https://your-okta-domain.com/oauth2/default> - <https://your-custom-issuer.com/> allowed_algorithms: - RS256 # Additional options: required_scope, target_audience, etc.
You can also specify where the token is expected (header, query parameter, or cookie) and other validation options. This allows you to support multiple IdPs and custom JWT issuers seamlessly [Oathkeeper JWT Authenticator](https://www.ory.sh/docs/oathkeeper/pipeline/authn#jwt). ### Custom Authorization Policies Ory Oathkeeper lets you define custom authorization policies (access rules) for your endpoints. You can write rules that specify: - Which endpoints are protected. - What authentication and authorization methods to use. - Which users or groups are allowed access. Rules are defined in YAML or JSON and can be as granular as needed. For example, you can require a specific scope or claim in the JWT for certain endpoints, or allow anonymous access to others. Oathkeeper can also integrate with Ory Keto for advanced, relationship-based access control if you need more complex policies [Oathkeeper Introduction](https://www.ory.sh/docs/oathkeeper). Summary: - Use Ory Oathkeeper’s jwt
authenticator to support JWTs from Okta, custom issuers, and other IdPs. - Write custom access rules to protect endpoints according to your business logic and customer requirements. If you need more advanced, relationship-based permissions, consider integrating Ory Keto for policy decision support. > If you need step-by-step examples or more details on writing rules, let me know!fresh-tomato-92389
06/25/2025, 12:30 PMbrief-egg-61061
06/25/2025, 12:31 PMbrief-egg-61061
06/25/2025, 12:31 PMoathkeeper.yml
), enable and configure the jwt
authenticator. Specify the JWKS URLs and trusted issuers for Okta and your custom IdP: yaml authenticators: jwt: enabled: true config: jwks_urls: - <https://your-okta-domain.com/oauth2/default/v1/keys> - <https://your-custom-issuer.com/.well-known/jwks.json> trusted_issuers: - <https://your-okta-domain.com/oauth2/default> - <https://your-custom-issuer.com/> allowed_algorithms: - RS256 # Optionally, set required_scope, target_audience, etc.
You can also specify where the token is expected (header, query parameter, or cookie) using the token_from
option if needed. [See: JWT Authenticator Configuration](https://www.ory.sh/docs/oathkeeper/pipeline/authn#jwt) --- ## 2. Write an Access Rule for a Protected Endpoint Create an access rule (e.g., access-rule-1.yaml
) to protect a specific endpoint and require JWT authentication: yaml id: access-rule-1 match: url: <http://my-app/protected-endpoint> methods: ["GET"] upstream: url: <http://my-backend-service> authenticators: - handler: jwt config: required_scope: ["read:data"] target_audience: ["<api://default>"] trusted_issuers: - <https://your-okta-domain.com/oauth2/default> - <https://your-custom-issuer.com/> authorizer: handler: allow mutators: - handler: noop
This rule: - Matches GET requests to /protected-endpoint
. - Requires a JWT with the read:data
scope and the correct audience and issuer. - Allows the request if authenticated. [See: JWT Access Rule Example](https://www.ory.sh/docs/oathkeeper/pipeline/authn#jwt-access-rule-example) --- ## 3. Start Oathkeeper with Your Configuration Make sure your Oathkeeper config points to your rules file: yaml access_rules: repositories: - file:///path/to/access-rule-1.yaml
[See: Configure and Deploy](https://www.ory.sh/docs/oathkeeper/configure-deploy) Start Oathkeeper: sh oathkeeper serve --config /path/to/oathkeeper.yml
--- ## 4. Test Your Setup - Send a request with a valid JWT from Okta or your custom issuer: sh curl -X GET -H 'Authorization: Bearer <valid-jwt>' <http://my-app/protected-endpoint>
You should receive a 200 OK if the token is valid and meets the rule requirements. - Send a request with an invalid or missing JWT: sh curl -X GET <http://my-app/protected-endpoint>
You should receive a 401 Unauthorized. --- ## 5. Write More Custom Policies You can create additional rules for other endpoints, requiring different scopes, audiences, or even using different authenticators or authorizers as needed. For advanced authorization, you can use the Keto authorizer to integrate with Ory Keto for fine-grained access control [Keto Authorizer](https://www.ory.sh/docs/oathkeeper/pipeline/authz#keto_engine_acp_ory). --- If you need more details on a specific step or want to see an example for a different scenario, let me know!fresh-tomato-92389
06/25/2025, 12:33 PMbrief-egg-61061
06/25/2025, 12:33 PMbrief-egg-61061
06/25/2025, 12:34 PMsh helm repo add ory <https://k8s.ory.sh/helm/charts> helm repo update
[Ory Kratos Enterprise License Kubernetes Quickstart](https://www.ory.sh/docs/self-hosted/oel/quickstart#kubernetes) --- ### 2. Create a Namespace sh kubectl create namespace ory
[Ory Kratos Enterprise License Kubernetes Quickstart](https://www.ory.sh/docs/self-hosted/oel/quickstart#kubernetes) --- ### 3. Prepare Your Access Rules as YAML Create a file, for example access-rules.yaml
, with your rules. Here’s a sample rule: yaml - id: "example-rule" version: v0.36.0-beta.4 upstream: url: <http://my-backend-service> preserve_host: true strip_path: /api/v1 match: url: <http://my-app/some-route/<.*>> methods: - GET - POST authenticators: - handler: jwt authorizer: handler: allow mutators: - handler: noop errors: - handler: json
[Access Rule YAML Example](https://www.ory.sh/docs/oathkeeper/api-access-rules#examples) --- ### 4. Mount the Rules File in Your Oathkeeper Deployment When using Helm, you can mount your rules file as a ConfigMap or Secret and reference it in your Oathkeeper configuration. In your values.yaml
for the Helm chart, set: yaml config: access_rules: repositories: - file:///etc/config/oathkeeper/access-rules.yaml
Then, mount your rules file at /etc/config/oathkeeper/access-rules.yaml
using a ConfigMap. --- ### 5. Install Oathkeeper with Helm sh helm install ory-oathkeeper ory/oathkeeper --namespace ory -f values.yaml
[Ory Oathkeeper Upgrade/Install with Helm](https://www.ory.sh/docs/self-hosted/oel/oathkeeper/upgrade-oathkeeper) --- ### 6. Test Your Setup After deployment, you can test your rules by sending requests to the Oathkeeper proxy endpoint and verifying the behavior matches your rule definitions. For example, use curl
to send requests and check for expected responses (e.g., 200 OK for allowed, 403/401 for denied). --- If you need more details on mounting files as ConfigMaps or writing specific rules, let me know!