Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while configuring annotations for OIDC authentication in ALB #2819

Closed
shivakumar5 opened this issue Sep 26, 2022 · 2 comments
Closed

Comments

@shivakumar5
Copy link

shivakumar5 commented Sep 26, 2022

Describe the bug
I have added all the required oidc annotations in ingress like below:

annotations: 
    alb.ingress.kubernetes.io/auth-type: 'oidc'
    alb.ingress.kubernetes.io/auth-on-unauthenticated-request: authenticate
    alb.ingress.kubernetes.io/auth-scope: 'openid'
    alb.ingress.kubernetes.io/auth-session-cookie: 'AWSELBAuthSessionCookie'
    alb.ingress.kubernetes.io/auth-session-timeout: '604800'    
    alb.ingress.kubernetes.io/auth-idp-oidc: '{"issuer":"issuer","authorizationEndpoint":"aendpoint","tokenEndpoint":"tendpoint","userInfoEndpoint":"uendpoint","secretName":"oidc-secret"}'

but I'm getting the error as "ingress Failed deploy model due to InternalFailure: status code: 500, request id: d25fe190-0c80-4c0e-a65c-8447f5a10ee8"

Also, If I go to ALB via aws console, listener rules are not showing up, it ll be blank as below:
image

And, If I add the oidc authentication manually with all the details, then my application works perfectly fine.

So, I think this might be an issue with annotations configuration.

Steps to reproduce
Configure OIDC using annotations

Environment

  • AWS Load Balancer controller version: 2.2.4
  • Kubernetes version: 1.21
  • Using EKS (yes/no), if so version? Yes, 1.21

Additional Context:

@kishorj
Copy link
Collaborator

kishorj commented Sep 27, 2022

@shivakumar5, what is your AWS region? Also verify whether you have https listeners, the secret is in the same namespace as the ingress.

@shivakumar5
Copy link
Author

This is resolved:

I was not encoding my secrets as base64 , so AWS was not accepting it as plain text.
I have encoded it in base64 and added in secrets, it worked.

it is mentioned here : https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.2/guide/ingress/annotations/#auth-idp-oidc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants