First, go to the defguard OpenID tab and click add new app button.
Add the name Portainer
Redirect Url add https://yourportainer.com where yourpotainer.com is the address of your portainer instance.
Select the below scopes
Then add your app. After successfully adding your app you can see it in the OpenID apps list. When you click on it you will be redirected to the client details page. From this page copy Client ID and Client secret values for later.
When you login to portainer go to Settings -> Authentication
On this page select: Authentication method: OAuth
Client ID -> Client ID from defguard available on client details page.
Client secret -> Client secret from defguard available on client details page.