Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Refresh & document OIDC support (#350) #351

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1405,31 +1405,6 @@ config:
# Possible backends: email|console
backend: 'console'

# List of OpenID Connect providers information. Each provider contains
# public info that is used by sequent-ui to show information about the
# providers, and private info that is used by iam for authentication.
#
# The logout_redirect_uri is used in case the election is configured to
# show a way to logout or even redirect after voting, and this URI can
# contain a __EVENT_ID__ that will be changed to the appropiate event_id
# before sending the user to it.
#
# openid_connect_providers:
# - public_info:
# id: example
# title: Authenticate to vote with Example
# description: Authenticate to vote with Example
# icon: https://www.example.com/favicon.ico
# authorization_endpoint: https://accounts.example.com/o/oauth2/v2/auth
# client_id: my_example_client_id.apps.example.com
# issuer: https://accounts.example.com
# token_endpoint: https://oauth2.example.com/token
# jwks_uri: https://www.example.com/oauth2/v3/certs
# logout_uri: https://accounts.example.com/o/oauth2/v2/auth_logout
# private_config:
# client_secret: example_secret
openid_connect_providers: []

# list of extra options, added at the end as configuration lines in the
# configuration file
extra_options: []
Expand Down
26 changes: 0 additions & 26 deletions doc/devel/auth1.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1359,33 +1359,7 @@ config:
extra_options: []
# - WHATEVER = 'VALUE'

# List of OpenID Connect providers information. Each provider contains
# public info that is used by sequent-ui to show information about the
# providers, and private info that is used by iam for authentication.
#
# The logout_redirect_uri is used in case the election is configured to
# show a way to logout or even redirect after voting, and this URI can
# contain a __EVENT_ID__ that will be changed to the appropiate event_id
# before sending the user to it.
#
# openid_connect_providers:
# - public_info:
# id: example
# title: Authenticate to vote with Example
# description: Authenticate to vote with Example
# icon: https://www.example.com/favicon.ico
# authorization_endpoint: https://accounts.example.com/o/oauth2/v2/auth
# client_id: my_example_client_id.apps.example.com
# issuer: https://accounts.example.com
# token_endpoint: https://oauth2.example.com/token
# jwks_uri: https://www.example.com/oauth2/v3/certs
# logout_uri: https://accounts.example.com/o/oauth2/v2/auth_logout
# private_config:
# client_secret: example_secret
openid_connect_providers: []

# Authorities

authorities:
- id: "auth1"
name: "Sequent 1"
Expand Down
27 changes: 1 addition & 26 deletions doc/devel/auth2.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1365,33 +1365,8 @@ config:
# configuration file
extra_options: []
# - WHATEVER = 'VALUE'

# List of OpenID Connect providers information. Each provider contains
# public info that is used by sequent-ui to show information about the
# providers, and private info that is used by iam for authentication.
#
# The logout_redirect_uri is used in case the election is configured to
# show a way to logout or even redirect after voting, and this URI can
# contain a __EVENT_ID__ that will be changed to the appropiate event_id
# before sending the user to it.
#
# openid_connect_providers:
# - public_info:
# id: example
# title: Authenticate to vote with Example
# description: Authenticate to vote with Example
# icon: https://www.example.com/favicon.ico
# authorization_endpoint: https://accounts.example.com/o/oauth2/v2/auth
# client_id: my_example_client_id.apps.example.com
# issuer: https://accounts.example.com
# token_endpoint: https://oauth2.example.com/token
# jwks_uri: https://www.example.com/oauth2/v3/certs
# logout_uri: https://accounts.example.com/o/oauth2/v2/auth_logout
# private_config:
# client_secret: example_secret


# Authorities

authorities:
- id: "auth1"
name: "Sequent 1"
Expand Down
26 changes: 0 additions & 26 deletions doc/devel/sequent.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1373,33 +1373,7 @@ config:
extra_options: []
# - WHATEVER = 'VALUE'

# List of OpenID Connect providers information. Each provider contains
# public info that is used by sequent-ui to show information about the
# providers, and private info that is used by iam for authentication.
#
# The logout_redirect_uri is used in case the election is configured to
# show a way to logout or even redirect after voting, and this URI can
# contain a __EVENT_ID__ that will be changed to the appropiate event_id
# before sending the user to it.
#
# openid_connect_providers:
# - public_info:
# id: example
# title: Authenticate to vote with Example
# description: Authenticate to vote with Example
# icon: https://www.example.com/favicon.ico
# authorization_endpoint: https://accounts.example.com/o/oauth2/v2/auth
# client_id: my_example_client_id.apps.example.com
# issuer: https://accounts.example.com
# token_endpoint: https://oauth2.example.com/token
# jwks_uri: https://www.example.com/oauth2/v3/certs
# logout_uri: https://accounts.example.com/o/oauth2/v2/auth_logout
# private_config:
# client_secret: example_secret
openid_connect_providers: []

# Authorities

authorities:
- id: "auth1"
name: "Sequent 1"
Expand Down
26 changes: 0 additions & 26 deletions doc/production/config.auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1375,33 +1375,7 @@ config:
extra_options: []
# - WHATEVER = 'VALUE'

# List of OpenID Connect providers information. Each provider contains
# public info that is used by sequent-ui to show information about the
# providers, and private info that is used by iam for authentication.
#
# The logout_redirect_uri is used in case the election is configured to
# show a way to logout or even redirect after voting, and this URI can
# contain a __EVENT_ID__ that will be changed to the appropiate event_id
# before sending the user to it.
#
# openid_connect_providers:
# - public_info:
# id: example
# title: Authenticate to vote with Example
# description: Authenticate to vote with Example
# icon: https://www.example.com/favicon.ico
# authorization_endpoint: https://accounts.example.com/o/oauth2/v2/auth
# client_id: my_example_client_id.apps.example.com
# issuer: https://accounts.example.com
# token_endpoint: https://oauth2.example.com/token
# jwks_uri: https://www.example.com/oauth2/v3/certs
# logout_uri: https://accounts.example.com/o/oauth2/v2/auth_logout
# private_config:
# client_secret: example_secret
openid_connect_providers: []

# Authorities

authorities:
- id: "auth1"
name: "Sequent 1"
Expand Down
26 changes: 0 additions & 26 deletions doc/production/config.master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1375,33 +1375,7 @@ config:
extra_options: []
# - WHATEVER = 'VALUE'

# List of OpenID Connect providers information. Each provider contains
# public info that is used by sequent-ui to show information about the
# providers, and private info that is used by iam for authentication.
#
# The logout_redirect_uri is used in case the election is configured to
# show a way to logout or even redirect after voting, and this URI can
# contain a __EVENT_ID__ that will be changed to the appropiate event_id
# before sending the user to it.
#
# openid_connect_providers:
# - public_info:
# id: example
# title: Authenticate to vote with Example
# description: Authenticate to vote with Example
# icon: https://www.example.com/favicon.ico
# authorization_endpoint: https://accounts.example.com/o/oauth2/v2/auth
# client_id: my_example_client_id.apps.example.com
# issuer: https://accounts.example.com
# token_endpoint: https://oauth2.example.com/token
# jwks_uri: https://www.example.com/oauth2/v3/certs
# logout_uri: https://accounts.example.com/o/oauth2/v2/auth_logout
# private_config:
# client_secret: example_secret
openid_connect_providers: []

# Authorities

authorities:
- id: "auth1"
name: "Sequent 1"
Expand Down
20 changes: 0 additions & 20 deletions iam/templates/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,26 +199,6 @@ def on_celery_setup_logging(**kwargs):

SMS_OTP_EXPIRE_SECONDS = {{config.iam.sms_otp.expire_seconds}}

OPENID_CONNECT_PROVIDERS_CONF = [
{% for provider in config.iam.openid_connect_providers %}
dict(
public_info = dict(
{% for key, value in provider.public_info.items() %}
{{key}}="{{value}}"{% if not loop.last %},{% endif %}

{% endfor %}
),
private_config = dict(
{% for key, value in provider.private_config.items() %}
{{key}}="{{value}}"{% if not loop.last %},{% endif %}
{% endfor %}

)
){% if not loop.last %},{% endif %}
{% endfor %}

]

OTL_URL = "https://{{ config.ballot_box.domain }}/election/__EVENT_ID__/public/otl/__SECRET__"

ALT_AUTH_BASE_URL = "https://{{ config.ballot_box.domain }}/election/__EVENT_ID__/public/login-alt/__AUTH_METHOD_ID__"
Expand Down
11 changes: 0 additions & 11 deletions sequent-ui/templates/SequentConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,6 @@ var SequentConfigData = {

],

// Information regarding OpenID Connect authentication
openIDConnectProviders: [
{% for provider in config.iam.openid_connect_providers %}
{
{% for key, value in provider.public_info.items() %}
"{{key}}": "{{value}}"{% if not loop.last %},{% endif %}
{% endfor %}
}{% if not loop.last %},{% endif %}
{% endfor %}
],

//Minimum loading time (milliseconds)
minLoadingTime: {{ config.sequent_ui.min_loading_time }},

Expand Down