Audiobookshelf
Configure OIDC authentication for Audiobookshelf
The following example variables are used, and should be replaced with your actual URLs.
audiobookshelf.example.com(The URL of your Audiobookshelf instance.)id.example.com(The URL of your Pocket ID instance.)
Pocket-ID setup
- In Pocket-ID create a new OIDC Client, name it, for example
audiobookshelf - Set a logo for this OIDC Client if you would like to.
- Set the callback URLs to:
https://audiobookshelf.example.com/auth/openid/callbackand add another one, for the mobile app tohttps://audiobookshelf.example.com/auth/openid/mobile-redirect. - Copy the
Client IDandClient Secretfor use in the next steps.
Audiobookshelf setup
- Log in to Audiobookshelf as an admin.
- Go to Settings → Authentication check the checkbox for OpenID Connect Authentication
- In the field Issuer URL put
id.example.comand click on Auto-Populate, this should automatically populate all the other URL fields. - Enter the Client ID.
- Enter the Client Secret.
- Change the Subfolder for Redirect URLs according to how you configured Audiobookshelf. In this example change it to None, if you are using a dedicated subdomain for it.
- Change Match existing users by, to what you want it to match an OIDC user with an existing (Audiobookshelf) user by.
- Toggle Auto Register to true, if you want to create a new user if it does not exist.
- Configure the group claim if you want.
[!CAUTION] If you configure group claim, you will not be able to sign in as user. If you're not part of admin, user or guest.
- Configure the abspermissions claim if you want.
[!CAUTION] If you configure abspermissions, you will not be able to sign in as a normal user. If your configuration for it is not valid or not configured.
Group Claim
If you want to automatically assign permissions based on group membership.
Audiobookshelf
Set the Group Claim under Settings → Authentication → OpenID Connect Authentication → Group Claim to groups.
Pocket-ID
Create a group admin, user or guest via User Groups → Add Group. Add the users depending on what permissions you want them to have to the groups.
Advanced Permission Claim
Audiobookshelf
Set the Advanced permission Claim under Settings → Authentication → OpenID Connect Authentication → Advanced Permission Claim to abspermissions.
Pocket-ID
- Create a custom claim for the group
yourgroupnameunder User Groups → Manage User Groups →yourgroupname→ ... → Edit → Custom Claims → + Add custom claim. - Set Key to
abspermissions - set value to a valid JSON like this: