I’ve got a spring boot app (backend) and angular app (frontend), protected by okta. As the setup worked locally I have containerized it with docker and it also worked locally from the backend and frontend docker containers, the only thing I had to do was forwarding the ports (spring boot: 8080:8080, angular 4200:80)
Subsequently I tried to create the probably most simple setup, namely one pod with two containers (backend and frontent) on okteto which is a pretty nice kubernetes provider. The containers got exposed nicely, I have a problem, however, by the login in the angular app. After attempting to login, I see the following:
http://localhost:4200/implicit/callback#id_token=...
in the address text box of the browser and the following error:
main-es2015.092d78be6704c3f71a6d.js:1 ERROR Error: Uncaught (in promise): AuthSdkError: Unable to retrieve OAuth redirect params cookie
However, I see no errors in my okta dev console.
I added the addresses exposed by my services to the login redirect URIs:
https://.cloud.okteto.net/login/oauth2/code/okta
https://.cloud.okteto.net/redirect
https://.cloud.okteto.net/implicit/callback
additionally to the localhost.* ones. It did not help.
and my deployment looks like this:
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend
spec:
selector:
matchLabels:
app: backend
template:
metadata:
labels:
app: backend
spec:
containers:
- image: registry.gitlab.com/<my-app>-backend
name: backend
ports:
- containerPort: 8080
name: http
- image: registry.gitlab.com/<my-app>-gui
name: frontend
ports:
- containerPort: 80
name: http
imagePullSecrets:
- name: gitlab-pull-secret
- name: gitlab-pull-secret-gui
//backend service
apiVersion: v1
kind: Service
metadata:
name: backend-svc
labels:
app: backend
annotations:
dev.okteto.com/auto-ingress: "true"
spec:
type: ClusterIP
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
app: backend
//frontend service
apiVersion: v1
kind: Service
metadata:
name: backend-svc
labels:
app: backend
annotations:
dev.okteto.com/auto-ingress: "true"
spec:
type: ClusterIP
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
app: backend
Any idea what else do I have to do? I’m strong neither with okta nor with kubernetes, so maybe it’s about kubernetes config, not sure.