{% extends "_layouts/cp" %} {% import "_includes/forms" as forms %} {% set title = provider.name~" Settings"|t %} {% set crumbs = [ { label: "OAuth"|t, url: url('oauth') }, { label: "Providers"|t, url: url('oauth/providers') } ] %} {% macro configWarning(setting, file) -%} {{ "This is being overridden by the {setting} config setting."|t({ setting: ''~setting~'' })|raw }} {%- endmacro %} {% from _self import configWarning %} {% set content %}
{{ getCsrfInput() }} {% if infos %}{% endif %}

{{ "Create an OAuth application"|t }}

{% if provider.getManagerUrl() %} {{ "Create an OAuth 2.0 application and enable associated providers in the {console}"|t({ console: ''~'{provider} API Manager'|t({provider:provider.name})~'.' })|raw }} {% else %} {{ "Create an OAuth 2.0 application and enable associated providers in the API Manager."|t }} {% endif %}

{{ "Once created, configure the application with the following settings. You might not need to use all of them."|t }}

{{ forms.textField({ label: 'Web Origin'|t, value: siteUrl, readonly: true, }) }} {{ forms.textField({ label: 'Redirect URI'|t, value: provider.getRedirectUri(), readonly: true, }) }}

{{ "Client ID & Secret"|t }}

{{ "Use the client ID & secret from the OAuth application that you've just created."|t }}

{{ forms.textField({ label: 'Client Id'|t, required: true, name: 'provider[clientId]', placeholder: infos ? (infos.clientId is empty and configInfos.clientId is defined ? configInfos.clientId) : (configInfos.clientId is defined ? configInfos.clientId), value: infos ? infos.clientId : null, errors: infos ? infos.errors('clientId') : null, warning: (infos and not infos.clientId is empty and configInfos.clientId is defined ? configWarning('oauth.'~provider.handle~'.clientId')), }) }} {{ forms.textField({ label: 'Client Secret'|t, required: true, name: 'provider[clientSecret]', placeholder: infos ? (infos.clientSecret is empty and configInfos.clientSecret is defined ? configInfos.clientSecret) : (configInfos.clientSecret is defined ? configInfos.clientSecret), value: infos ? infos.clientSecret : null, errors: infos ? infos.errors('clientSecret') : null, warning: (infos and not infos.clientSecret is empty and configInfos.clientSecret is defined ? configWarning('oauth.'~provider.handle~'.clientSecret')), }) }}
{% endset %}