Audiobookshelf
Sign in to the Audiobookshelf audiobook and podcast server with Pocket ID.
Create the client in Pocket ID
Section titled “Create the client in Pocket ID”- In Pocket ID, open Administration → OIDC Clients and click Add OIDC Client.
- Enter a name such as
Audiobookshelfand add the callback URLs:https://audiobookshelf.example.com/auth/openid/callbackhttps://audiobookshelf.example.com/auth/openid/mobile-redirect - Click Create and copy the Client ID and the Client secret. The client secret is only shown once.
- On the client’s Access tab, select the groups that may sign in under Allowed User Groups, or choose All Users.
Configure Audiobookshelf
Section titled “Configure Audiobookshelf”- Sign in to Audiobookshelf as an admin.
- Open Settings → Authentication and select OpenID Connect Authentication.
- Enter
https://id.example.comin Issuer URL and click Auto-Populate. This fills in all the other URL fields. - Enter the Client ID from Pocket ID.
- Enter the Client secret from Pocket ID.
- Change Subfolder for Redirect URLs to match how you set up Audiobookshelf. In this example, change it to None if you use a dedicated subdomain for Audiobookshelf.
- Set Match existing users by to how an OIDC user should be matched with an existing Audiobookshelf user.
- Turn on Auto Register if you want to create a new user when it doesn’t exist yet.
- (Optional) Configure the Group Claim (see Group claim).
If you configure Group Claim, users who aren’t in the
admin,userorguestgroup can’t sign in. - (Optional) Configure the
abspermissionsclaim (see Advanced permission claim).If you configure
abspermissions, normal users can’t sign in when the claim is missing or invalid.
Group claim
Section titled “Group claim”Use this if you want to assign permissions automatically based on group membership.
Audiobookshelf
Section titled “Audiobookshelf”Set Group Claim under Settings → Authentication → OpenID Connect Authentication → Group Claim to groups.
Pocket ID
Section titled “Pocket ID”- In Pocket ID, open Administration → User Groups.
- Click Add Group and create a group with the Name
admin,userorguest. - Add users to the group that matches the permissions you want them to have.
Advanced permission claim
Section titled “Advanced permission claim”Audiobookshelf
Section titled “Audiobookshelf”Set Advanced Permission Claim under Settings → Authentication → OpenID Connect Authentication → Advanced Permission Claim to abspermissions.
Pocket ID
Section titled “Pocket ID”- In Pocket ID, open Administration → User Groups and open the group.
- Under Custom Claims, add a claim with the key
abspermissions. - Set the value to valid JSON like this:
{"canDownload": true,"canAccessAllLibraries": true,"canAccessAllTags": true,"tagsAreDenylist": false}
- Save the custom claims.
abspermissions fields
Section titled “abspermissions fields”{ "canDownload": false, //Allows a user to download content "canUpload": false, //Allows a user to Upload content "canDelete": false, //Allows a user to delete content "canUpdate": false, "canAccessExplicitContent": false, //Allow access to explicit content "canAccessAllLibraries": false, //Allow access to all Libraries (only set to true if nothing is specified below) "canAccessAllTags": false, //Allow access to all tags (only set to true if nothing is specified below) "canCreateEReader": false, "tagsAreDenylist": false, //Invert the allowed tags list to a deny list "allowedLibraries": [ //Specify which libraries are allowed to be accessed via the library ID "5406ba8a-16e1-451d-96d7-4931b0a0d966", //You can get this ID via the Audiobookshelf api "918fd848-7c1d-4a02-818a-847435a879ca" //https://audiobookshelf.example.com/api/libraries ], "allowedTags": [ //Specify which tags are allowed (or denied) "Romance", "Fantasy", "ThirdTag" ]}