# A members' library with an outside sign-in

*Collection: Access Control & Protection · Category: Access Control · Availability: FileDeck Pro · Canonical URL: https://www.getfiledeck.com/docs/members-library-outside-login/*

Associations, unions and clubs often keep their members somewhere other than
WordPress: a membership or association-management system, with its own sign-in.
FileDeck can still keep member documents for members, as long as that sign-in
also signs the member in to your WordPress site, which is what single sign-on
and JWT login plugins do.

> **FileDeck Pro** — this feature is included in all Pro plans. [See pricing](https://www.getfiledeck.com/pricing/)

## The three pieces

1. **Members get a WordPress account when they sign in.** A single sign-on
   (OpenID Connect or SAML) or JWT login plugin does this: your membership
   system vouches for the member, and the plugin signs them in to WordPress,
   creating their account the first time.
2. **FileDeck decides what they can open.** Either by the role the sign-on
   plugin gives members ([role restrictions](https://www.getfiledeck.com/docs/role-user-restrictions/)),
   or by a field it saves on their profile, such as a membership status
   ([member fields](https://www.getfiledeck.com/docs/membership-plans/#member-fields)).
3. **Signed-out visitors are shown the way in.** A sign-in link above the
   library and, if you switch it on, a document page that sends them to sign in
   and back (for documents restricted by role).

## Point the sign-in link at your members' sign-in

Under **Documents → Settings → Downloads → Members sign in at**, enter the
address where members sign in. Where that page can send people back
afterwards, put `{redirect}` where the return address goes:

```
https://members.example.org/login?return={redirect}
```

FileDeck fills `{redirect}` in with the page the visitor was on. The second box
sets the link's text, for example *Sign in with your membership*. Leave the
address empty to use the WordPress sign-in page, which is right when your
sign-on plugin adds its button there.

Signed-out visitors then see **Members: sign in…** above a library that has
locked documents, or one that shows a members-only category.

To also send a signed-out visitor who opens a members-only document's page to sign in and back, set **Sign-in links** to **Above libraries, and on members-only document pages**; [when access is refused](https://www.getfiledeck.com/docs/access-denied-page/) explains what that trades away. A library can override the link in the [shortcode](https://www.getfiledeck.com/docs/shortcode-reference/) or the library builder: `sign_in="always"` for a members' page whose documents are all hidden, `sign_in="never"` for none. Setting **Sign-in links** to **Never** turns it off for the whole site. 

## Setup A: the sign-on plugin gives members a role

Most sign-on and JWT plugins let you choose the role a new account gets.

1. Give members their own role, for example *Member*, in the sign-on plugin.
2. Restrict the members' category to that role: edit the category under
   **Documents → Categories** and tick it under **Restrict to roles**.
3. Set **Members sign in at**, as above.

Signed-out visitors see the members' documents with a padlock and the sign-in
link; once signed in, the padlocks go. With document pages switched on under
**Sign-in links**, a link to a members-only document, emailed or shared, takes a
signed-out member to sign in and back to it.

## Setup B: membership status is a field on the member's profile

When membership can lapse, a role set once at first sign-in goes stale. Many
sign-on plugins can instead save details the membership system sends (an
OpenID Connect claim, a SAML attribute, a JWT field) to the member's profile,
refreshed at every sign-in. FileDeck can check that field.

1. In the sign-on plugin, map the membership status to a profile field, for
   example `membership_status`. Its documentation calls this claim, attribute
   or user-meta mapping.
2. Under **Documents → Settings → Downloads → Member fields**, add a rule:
   `Current members | membership_status | active`.
3. Edit the members' category and tick **Member field — Current members** in
   its plan list.
4. Set **Members sign in at**, as above.

A category gated this way is a client area: its documents are hidden, not
padlocked, from people it doesn't admit. So scope the members' library page to that category, which shows the sign-in link on its own, or give it `sign_in="always"`. A link to one of these documents, opened signed out, shows the not-found page rather than a sign-in prompt, because a prompt would confirm the document exists: link members to the library page instead. 

## If your membership system has no single sign-on

FileDeck checks people who are signed in to your WordPress site. If your
membership or association system can't sign members in to an outside site
(ask its support whether it offers OpenID Connect, SAML or a JWT login), the
options are a WordPress account per member, or a
[category password](https://www.getfiledeck.com/docs/password-protection/) shared with members.

## FAQ

### Does FileDeck connect to my membership system itself?

No. The sign-on plugin does that; FileDeck reads the WordPress account it
creates, its role and its profile fields. That keeps FileDeck working with any
system your sign-on plugin supports.

### Where do signed-out members land after signing in?

Back on the page they started from, when the sign-in page honours the return
address you mark with `{redirect}`. FileDeck's own query parameters (a
library's search and filters) are left off it.

### Will the sign-in link appear on public libraries?

Only on a library with locked documents, or one showing a members-only category, unless you set `sign_in="always"` on it. 

### Where does this fit in a members' library?

The [members-only document library guide](https://www.getfiledeck.com/members-document-library/) covers the rest: which documents each tier sees, search, and testing it logged out.
