We are going to implement oauth2_proxy from bitly (https://github.com/bitly/oauth2_proxy). We will be following the steps indicated in the documentation for Azure AD (https://docs.microsoft.com/en-us/azure/active-directory/).
First, register an app with Azure AD as shown in the following screenshot:
![](https://static.packt-cdn.com/products/9781789536102/graphics/assets/63ef4346-83a6-4991-9fe4-b425bc92c276.png)
Next, create a client ID secret by performing the following steps:
- Select Certificates & secrets and go to New client secret:
![](https://static.packt-cdn.com/products/9781789536102/graphics/assets/fc638316-74a1-40eb-9616-4c52fb9ba012.png)
- Add the secret:
![](https://static.packt-cdn.com/products/9781789536102/graphics/assets/0aca5c1c-0151-4d14-9d15-06a73ad93470.png)
- Click on the Copy icon and save the secret in a safe place:
![](https://static.packt-cdn.com/products/9781789536102/graphics/assets/45a9d97e-e37d-4351-9afa-08f1a25fdf69.png)
- Save the client and the tenant ID:
![](https://static.packt-cdn.com/products/9781789536102/graphics/assets/749fdac6-b08b-4f4f-86cd-1c12eb06ffe5.png)
After creating the client ID secret, we will now launch oauth2_proxy with the following YAML file:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: oauth2-proxy
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
app: oauth2-proxy
template:
metadata:
labels...