inveniosoftware / inveniosoftware/invenio-cli
Configuring Authentication methods
- Dominant language
- Python
- Stars
- 14
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Description
As part of `invenio-cli init`, it should be possible to configure what methods of authentication (and sign-up) are available for the instance. This can be achieved via some basic flag selections, which translate to different kind of entries being present in the generated `invenio.cfg` file.
So if in the cookiecutter the user selected:
```
$ invenio-cli init --flavour=RDM
Initializing RDM application...
project_name [My Site]: Foobar RDM
project_shortname [foobar-rdm]:
...
Select elasticsearch:
1 - 7
2 - 6
Choose from 1, 2 [1]:
Use local acconts? [N/y]:
Select OAuth2 providers:
1 - GitHub
2 - ORCID
3 - Globus
4 - Custom
Choose none or some of 1, 2, 3, 4: <1, 2, 4>
Use SAML? [N/y]:
Use LDAP? [N/y]:
```
The following `invenio.cfg` would be generated (along with some extra directories for SAML and the Custom OAuth config):
```python
# Authentication
# =============
# Local accounts
SECURITY_REGISTERABLE = False
from invenio_oauthclient.contrib import github
from invenio_oauthclient.contrib import orcid
from foobar_rdm.oauth import custom
OAUTHCLIENT_REMOTE_APPS = dict(
github=github.REMOTE_APP,
orcid=orcid.REMOTE_APP,
custom=custom.REMOTE_APP,
)
# GitHub OAuth2
GITHUB_APP_CREDENTIALS = dict(
consumer_key='changeme',
consumer_secret='changeme',
)
# ORCID OAuth2
ORCID_APP_CREDENTIALS = dict(
consumer_key="changeme",
consumer_secret="changeme",
)
# Custom OAuth2
CUSTOM_APP_CREDENTIALS = dict(
consumer_key='changeme',
consumer_secret='changeme',
)
# SAML
SSO_SAML_IDPS = {
"idp-abc": {
"settings_file_path": "./saml/idb-abc.json",
},
...
}
# LDAP
LDAPCLIENT_SERVER_HOSTNAME = ''
LDAPCLIENT_SEARCH_BASE = ''
LDAPCLIENT_BIND_BASE = ''
```
Contributor guide
Assessment
This issue has not been assessed yet.