keycloak-memoizeit
Changes
admin-ui/src/main/resources/META-INF/resources/admin/partials/provider/facebook-help.html 32(+0 -32)
docbook/reference/en/en-US/master.xml 28(+28 -0)
docbook/reference/en/en-US/modules/email.xml 40(+40 -0)
pom.xml 2(+1 -1)
Details
diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/realm.js b/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/realm.js
index b7b113a..fcd5d13 100755
--- a/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/realm.js
+++ b/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/realm.js
@@ -696,15 +696,6 @@ module.controller('RealmSocialCtrl', function($scope, realm, Realm, $location, N
initSocial();
};
- $scope.openHelp = function(pId) {
- $scope.helpPId = pId;
- $scope.providerHelpModal = true;
- };
-
- $scope.closeHelp = function() {
- $scope.providerHelpModal = false;
- };
-
});
module.controller('RealmTokenDetailCtrl', function($scope, Realm, realm, $http, $location, Dialog, Notifications, TimeUnit) {
diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-credentials.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-credentials.html
index d027574..a02eb1a 100755
--- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-credentials.html
+++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-credentials.html
@@ -11,7 +11,7 @@
<li class="active"><a href="#/realms/{{realm.realm}}/required-credentials">Credentials</a></li>
<li><a href="#/realms/{{realm.realm}}/token-settings">Token</a></li>
<li><a href="#/realms/{{realm.realm}}/keys-settings">Keys</a></li>
- <li><a href="#/realms/{{realm.realm}}/smtp-settings">SMTP</a></li>
+ <li><a href="#/realms/{{realm.realm}}/smtp-settings">Email</a></li>
</ul>
</div>
<div id="content">
diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-default-roles.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-default-roles.html
index e2a5314..6644ef2 100755
--- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-default-roles.html
+++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-default-roles.html
@@ -11,7 +11,7 @@
<li><a href="#/realms/{{realm.realm}}/required-credentials">Credentials</a></li>
<li><a href="#/realms/{{realm.realm}}/token-settings">Token</a></li>
<li><a href="#/realms/{{realm.realm}}/keys-settings">Keys</a></li>
- <li><a href="#/realms/{{realm.realm}}/smtp-settings">SMTP</a></li>
+ <li><a href="#/realms/{{realm.realm}}/smtp-settings">Email</a></li>
</ul>
</div>
<div id="content">
diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-detail.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-detail.html
index 726d56f..c71a4a6 100755
--- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-detail.html
+++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-detail.html
@@ -11,7 +11,7 @@
<li><a href="#/realms/{{realm.realm}}/required-credentials">Credentials</a></li>
<li><a href="#/realms/{{realm.realm}}/token-settings">Token</a></li>
<li><a href="#/realms/{{realm.realm}}/keys-settings">Keys</a></li>
- <li><a href="#/realms/{{realm.realm}}/smtp-settings">SMTP</a></li>
+ <li><a href="#/realms/{{realm.realm}}/smtp-settings">Email</a></li>
</ul>
</div>
<div id="content">
diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-keys.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-keys.html
index a05f12b..b00c969 100755
--- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-keys.html
+++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-keys.html
@@ -11,7 +11,7 @@
<li><a href="#/realms/{{realm.realm}}/required-credentials">Credentials</a></li>
<li><a href="#/realms/{{realm.realm}}/token-settings">Token</a></li>
<li class="active"><a href="#/realms/{{realm.realm}}/keys-settings">Keys</a></li>
- <li><a href="#/realms/{{realm.realm}}/smtp-settings">SMTP</a></li>
+ <li><a href="#/realms/{{realm.realm}}/smtp-settings">Email</a></li>
</ul>
</div>
<div id="content">
diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-smtp.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-smtp.html
index 1f685f9..2a2d313 100755
--- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-smtp.html
+++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-smtp.html
@@ -11,7 +11,7 @@
<li><a href="#/realms/{{realm.realm}}/required-credentials">Credentials</a></li>
<li><a href="#/realms/{{realm.realm}}/token-settings">Token</a></li>
<li><a href="#/realms/{{realm.realm}}/keys-settings">Keys</a></li>
- <li class="active"><a href="#/realms/{{realm.realm}}/smtp-settings">SMTP</a></li>
+ <li class="active"><a href="#/realms/{{realm.realm}}/smtp-settings">Email</a></li>
</ul>
</div>
<div id="content">
@@ -20,7 +20,7 @@
<li><a href="#/realms/{{realm.realm}}">Settings</a></li>
<li class="active">SMTP Configuration</li>
</ol>
- <h2 class="pull-left"><span>{{realm.realm}}</span> SMTP Settings</h2>
+ <h2 class="pull-left"><span>{{realm.realm}}</span> Email Server Settings</h2>
<p class="subtitle"><span class="required">*</span> Required fields</p>
<form name="realmForm" novalidate>
<fieldset>
@@ -40,7 +40,7 @@
<div class="form-group clearfix">
<label for="smtpFrom" class="control-label">From <span class="required">*</span></label>
<div class="controls">
- <input id="smtpFrom" type="email" ng-model="realm.smtpServer.from" placeholder="SMTP From" required>
+ <input id="smtpFrom" type="email" ng-model="realm.smtpServer.from" placeholder="Sender Email Address" required>
</div>
</div>
<div class="form-group clearfix">
@@ -53,18 +53,18 @@
</div>
</fieldset>
<fieldset>
- <legend collapsed><span class="text">Authentication</span></legend>
+ <legend uncollapsed><span class="text">Authentication</span></legend>
<div class="form-group clearfix">
- <label for="smtpAuth" class="control-label">Enabled</label>
+ <label for="smtpAuth" class="control-label">Enable Authentication</label>
<input ng-model="realm.smtpServer.auth" name="smtpAuth" id="smtpAuth" onoffswitch />
</div>
- <div class="form-group clearfix">
+ <div class="form-group clearfix" data-ng-show="realm.smtpServer.auth">
<label for="smtpUsername" class="control-label">Username <span class="required" ng-show="realm.smtpServer.auth">*</span></label>
<div class="controls">
<input id="smtpUsername" type="text" ng-model="realm.smtpServer.user" placeholder="Login Username" ng-disabled="!realm.smtpServer.auth" ng-required="realm.smtpServer.auth">
</div>
</div>
- <div class="form-group clearfix">
+ <div class="form-group clearfix" data-ng-show="realm.smtpServer.auth">
<label for="smtpPassword" class="control-label">Password <span class="required" ng-show="realm.smtpServer.auth">*</span></label>
<div class="controls">
<input id="smtpPassword" type="password" ng-model="realm.smtpServer.password" placeholder="Login Password" ng-disabled="!realm.smtpServer.auth" ng-required="realm.smtpServer.auth">
diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-social.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-social.html
index bd6dde2..5a75457 100755
--- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-social.html
+++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-social.html
@@ -11,7 +11,7 @@
<li><a href="#/realms/{{realm.realm}}/required-credentials">Credentials</a></li>
<li><a href="#/realms/{{realm.realm}}/token-settings">Token</a></li>
<li><a href="#/realms/{{realm.realm}}/keys-settings">Keys</a></li>
- <li><a href="#/realms/{{realm.realm}}/smtp-settings">SMTP</a></li>
+ <li><a href="#/realms/{{realm.realm}}/smtp-settings">Email</a></li>
</ul>
</div>
<div id="content">
@@ -21,6 +21,12 @@
<li class="active">Social</li>
</ol>
<h2><span>{{realm.realm}}</span> Social Providers Settings</h2>
+
+
+ <div class="feedback info inline">
+ <p><strong>Social Callback URL:</strong> {{callbackUrl}}</p>
+ </div>
+
<form name="realmForm" novalidate>
<fieldset>
<div>
@@ -64,7 +70,6 @@
ng-class="{'dirty': postSaveProviders.indexOf(pId) > -1}" required>
</td>
<td>
- <div class="action-div"><i class="icon-question" ng-click="openHelp(pId)"></i></div>
<div class="action-div"><i class="icon-remove" ng-click="removeProvider(pId)"></i></div>
</td>
</tr>
@@ -72,6 +77,7 @@
</table>
</div>
</fieldset>
+
<div class="form-actions">
<button type="submit" kc-save class="primary" data-ng-show="changed">Save
changes
@@ -86,22 +92,6 @@
</div>
</div>
-<div modal="providerHelpModal" close="closeHelp()" options="opts">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h3>Configure {{helpPId}}</h3>
- </div>
- <div class="modal-body">
- <div ng-include src="'partials/provider/'+ helpPId +'-help.html'"></div>
- </div>
- <div class="modal-footer">
- <button ng-click="closeHelp()">Close</button>
- </div>
- </div>
- </div>
-</div>
-
<!-- TODO remove once this page is properly styled -->
<style type="text/css">
.social-provider input.ng-invalid.dirty,
diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-tokens.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-tokens.html
index 0ea6617..802bc45 100755
--- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-tokens.html
+++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-tokens.html
@@ -11,7 +11,7 @@
<li><a href="#/realms/{{realm.realm}}/required-credentials">Credentials</a></li>
<li class="active"><a href="#/realms/{{realm.realm}}/token-settings">Token</a></li>
<li><a href="#/realms/{{realm.realm}}/keys-settings">Keys</a></li>
- <li><a href="#/realms/{{realm.realm}}/smtp-settings">SMTP</a></li>
+ <li><a href="#/realms/{{realm.realm}}/smtp-settings">Email</a></li>
</ul>
</div>
<div id="content">
diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/role-detail.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/role-detail.html
index 3e05f34..50cf512 100755
--- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/role-detail.html
+++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/role-detail.html
@@ -11,7 +11,7 @@
<li><a href="#/realms/{{realm.realm}}/required-credentials">Credentials</a></li>
<li><a href="#/realms/{{realm.realm}}/token-settings">Token</a></li>
<li><a href="#/realms/{{realm.realm}}/keys-settings">Keys</a></li>
- <li><a href="#/realms/{{realm.realm}}/smtp-settings">SMTP</a></li>
+ <li><a href="#/realms/{{realm.realm}}/smtp-settings">Email</a></li>
</ul>
</div>
<div id="content">
diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/role-list.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/role-list.html
index 213342a..34af283 100755
--- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/role-list.html
+++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/role-list.html
@@ -11,7 +11,7 @@
<li><a href="#/realms/{{realm.realm}}/required-credentials">Credentials</a></li>
<li><a href="#/realms/{{realm.realm}}/token-settings">Token</a></li>
<li><a href="#/realms/{{realm.realm}}/keys-settings">Keys</a></li>
- <li><a href="#/realms/{{realm.realm}}/smtp-settings">SMTP</a></li>
+ <li><a href="#/realms/{{realm.realm}}/smtp-settings">Email</a></li>
</ul>
</div>
<div id="content">
docbook/reference/en/en-US/master.xml 28(+28 -0)
diff --git a/docbook/reference/en/en-US/master.xml b/docbook/reference/en/en-US/master.xml
index a984d7d..f2c3920 100755
--- a/docbook/reference/en/en-US/master.xml
+++ b/docbook/reference/en/en-US/master.xml
@@ -7,6 +7,12 @@
<!ENTITY AdapterConfig SYSTEM "modules/adapter-config.xml">
<!ENTITY WildflyAdapter SYSTEM "modules/wildfly-adapter.xml">
<!ENTITY EAP6Adapter SYSTEM "modules/eap6-adapter.xml">
+ <!ENTITY SocialConfig SYSTEM "modules/social-config.xml">
+ <!ENTITY SocialFacebook SYSTEM "modules/social-facebook.xml">
+ <!ENTITY SocialGoogle SYSTEM "modules/social-google.xml">
+ <!ENTITY SocialTwitter SYSTEM "modules/social-twitter.xml">
+ <!ENTITY SocialProviderSPI SYSTEM "modules/social-spi.xml">
+ <!ENTITY Email SYSTEM "modules/email.xml">
]>
<book>
@@ -55,5 +61,27 @@
&EAP6Adapter;
</chapter>
+ <chapter>
+ <title>Social</title>
+ <para>
+ Social login description
+ </para>
+ &SocialConfig;
+ &SocialFacebook;
+ &SocialGoogle;
+ &SocialTwitter;
+ &SocialProviderSPI;
+ </chapter>
+
+ <chapter>
+ <title>Email</title>
+ <para>
+ Keycloak sends emails to users to verify their email address. Emails are also used to allow users to
+ safely restore their username and passwords.
+ </para>
+ &Email;
+ </chapter>
+
</book>
+
docbook/reference/en/en-US/modules/email.xml 40(+40 -0)
diff --git a/docbook/reference/en/en-US/modules/email.xml b/docbook/reference/en/en-US/modules/email.xml
new file mode 100644
index 0000000..692952a
--- /dev/null
+++ b/docbook/reference/en/en-US/modules/email.xml
@@ -0,0 +1,40 @@
+<section id="email-config">
+ <title>Email Server Config</title>
+ <para>
+ To enable Keycloak to send emails you need to provide Keycloak with your SMTP server settings. If you don't have
+ a SMTP server you can use one of many hosted solutions (such as Sendgrid or smtp2go).
+ </para>
+
+ <para>
+ To configure your SMTP server, open the <literal>Keycloak Admin Console</literal>, select your realm from the drop-down box in the
+ top-menu, then click on <literal>Email</literal> in the sub-menu.
+ </para>
+
+ <para>
+ You are required to fill in the <literal>Host</literal> and <literal>Port</literal> for your SMTP server (the default port for SMTP is 25). You also have
+ to specify the sender email address (<literal>From</literal>). The other options are optional.
+ </para>
+
+ <para>
+ The screenshot below shows a simple example where the SMTP server doesn't use SSL or TLS and doesn't require authentication.
+ </para>
+
+ <imagedata fileref="images/email-simple-example.png"/>
+
+ <section>
+ <title>Enable SSL or TLS</title>
+ <para>
+ As emails are used for recovering usernames and passwords it's recommended to use SSL or TLS, especially if the SMTP server
+ is on an external network. To enable SSL click on <literal>Enable SSL</literal> or to enable TLS click on <literal>Enable TLS</literal>.
+ You will most likely also need to change the <literal>Port</literal> (the default port for SSL/TLS is 465).
+ </para>
+ </section>
+
+ <section>
+ <title>Authentication</title>
+ <para>
+ If your SMTP server requires authentication click on <literal>Enable Authentication</literal> and insert
+ the <literal>Username</literal> and <literal>Password</literal>.
+ </para>
+ </section>
+</section>
\ No newline at end of file
diff --git a/docbook/reference/en/en-US/modules/social-config.xml b/docbook/reference/en/en-US/modules/social-config.xml
new file mode 100644
index 0000000..3de1328
--- /dev/null
+++ b/docbook/reference/en/en-US/modules/social-config.xml
@@ -0,0 +1,17 @@
+<section id="social-config">
+ <title>Social Login Config</title>
+ <para>
+ Social login config description
+ </para>
+
+ <section id="social-callbackurl">
+ <title>Social Callback URL</title>
+ <para>
+ There is a single callback url used by all realms and social providers. This makes it possible to share
+ the configuration for a social network between multiple realms. An example callback url is
+ <literal>http://localhost:8080/auth/rest/social/callback</literal>. To get the callback url for your server
+ replace <literal>http://localhost:8080</literal> with the base address of your server. You can also
+ find the callback url in the Keycloak Admin Console under social settings.
+ </para>
+ </section>
+</section>
\ No newline at end of file
diff --git a/docbook/reference/en/en-US/modules/social-facebook.xml b/docbook/reference/en/en-US/modules/social-facebook.xml
new file mode 100644
index 0000000..f173d21
--- /dev/null
+++ b/docbook/reference/en/en-US/modules/social-facebook.xml
@@ -0,0 +1,45 @@
+<section id="social-facebook">
+ <title>Facebook</title>
+ <para>
+ To enable login with Facebook you first have to create an app in the
+ <ulink url="https://developers.facebook.com/">Facebook Developer Console</ulink>. Then you need to copy
+ the client id and secret into the Keycloak Admin Console.
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Log in to the <ulink url="https://developers.facebook.com/">Facebook Developer Console</ulink>. Click
+ <literal>Apps</literal> in the menu and select <literal>Create a New App</literal>. Use any value for
+ <literal>Display Name</literal> and <literal>Category</literal> you want, then click the
+ <literal>Create App</literal> button. Wait for the project to be created (this may take a while). If after
+ creating the app you are not redirected to the app settings, click on <literal>Apps</literal> in the
+ menu and select the app you created.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Once the app has been created click on <literal>Settings</literal> in sidebar on the left. Then click
+ on <literal>Advanced</literal>. Under <literal>Security</literal> make sure
+ <literal>Client OAuth Login</literal> is enabled. In <literal>Valid OAuth redirect URIs</literal> insert
+ the <link linkend="social-callbackurl">social callback url</link>. Facebook doesn't allow
+ <literal>localhost</literal> in the redirect URI, so if you are testing on a local server replace
+ <literal>localhost</literal> with <literal>127.0.0.1</literal>. Scroll down and click on the
+ <literal>Save Changes</literal> button.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <literal>Status & Review</literal> and select <literal>YES</literal> for <literal>Do you want
+ to make this app and all its live features available to the general public?</literal>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Click <literal>Basic</literal>. Copy <literal>App ID</literal> and <literal>App Secret</literal>
+ (click <literal>show</literal>) from the <ulink url="https://developers.facebook.com/">Facebook Developer Console</ulink> into the
+ settings page in the Keycloak Admin Console as the <literal>Key</literal> and <literal>Secret</literal>. Then
+ click <literal>Save</literal> in the Keycloak Admin Console to enable login with Facebook.
+ </para>
+ </listitem>
+ </orderedlist>
+</section>
\ No newline at end of file
diff --git a/docbook/reference/en/en-US/modules/social-google.xml b/docbook/reference/en/en-US/modules/social-google.xml
new file mode 100644
index 0000000..6be385d
--- /dev/null
+++ b/docbook/reference/en/en-US/modules/social-google.xml
@@ -0,0 +1,48 @@
+<section id="social-google">
+ <title>Google</title>
+ <para>
+ To enable login with Google you first have to create a project and a client in the
+ <ulink url="https://cloud.google.com/console/project">Google Developer Console</ulink>. Then you need to copy
+ the client id and secret into the Keycloak Admin Console.
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Log in to the <ulink url="https://cloud.google.com/console/project">Google Developer Console</ulink>. Click the
+ <literal>Create Project</literal> button. Use any value for <literal>Project name</literal> and
+ <literal>Project ID</literal> you want, then click the <literal>Create</literal> button. Wait for the project to
+ be created (this may take a while).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Once the project has been created click on <literal>APIs & auth</literal> in sidebar on the left. To retrieve
+ user profiles the <literal>Google+ API</literal> has to be enabled. Scroll down to find it in the list. If its
+ status is <literal>OFF</literal>, click on <literal>OFF</literal> to enable it (it should move to the top of
+ the list and the status should be <literal>ON</literal>).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Now click <literal>Credentials</literal> in the sidebar on the left. Then click
+ <literal>Create New Client ID</literal>. Select <literal>Web application</literal> as
+ <literal>Application type</literal>. Empty the <literal>Authorized Javascript origins</literal> textarea. In
+ <literal>Authorized redirect URI</literal> enter the <link linkend="social-callbackurl">social callback url</link>
+ for your realm. Click the <literal>Create Client ID</literal> button.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Copy <literal>Client ID</literal> and <literal>Client secret</literal> from the
+ <ulink url="https://cloud.google.com/console/project">Google Developer Console</ulink> into the settings
+ page in the Keycloak Admin Console as the <literal>Key</literal> and <literal>Secret</literal>. Then click
+ <literal>Save</literal> in the Keycloak Admin Console to enable login with Google.
+ </para>
+ </listitem>
+ </orderedlist>
+ <para>
+ You may also want to configure how the Google Consent Screen looks when users log in to your application via
+ Google. To do this go to <ulink url="https://cloud.google.com/console/project">Google Developer Console</ulink>
+ and click on <literal>Consent Screen</literal> in the sidebar to the left.
+ </para>
+</section>
\ No newline at end of file
diff --git a/docbook/reference/en/en-US/modules/social-spi.xml b/docbook/reference/en/en-US/modules/social-spi.xml
new file mode 100644
index 0000000..b6de7f3
--- /dev/null
+++ b/docbook/reference/en/en-US/modules/social-spi.xml
@@ -0,0 +1,11 @@
+<section id="social-spi">
+ <title>Social Provider SPI</title>
+ <para>
+ Keycloak provides an SPI to make it easy to add additional social providers. This is done by implementing the
+ <ulink url="https://raw.github.com/keycloak/keycloak/master/social/core/src/main/java/org/keycloak/social/SocialProvider.java">SocialProvider</ulink>
+ interface and providing a provider configuration file (<literal>META-INF/services/org.keycloak.social.SocialProvider</literal>).
+ </para>
+ <para>
+ A good reference for implementing a Social Provider is the <ulink url="https://github.com/keycloak/keycloak/tree/master/social/google">Google provider</ulink>.
+ </para>
+</section>
\ No newline at end of file
diff --git a/docbook/reference/en/en-US/modules/social-twitter.xml b/docbook/reference/en/en-US/modules/social-twitter.xml
new file mode 100644
index 0000000..316a178
--- /dev/null
+++ b/docbook/reference/en/en-US/modules/social-twitter.xml
@@ -0,0 +1,35 @@
+<section id="social-twitter">
+ <title>Twitter</title>
+ <para>
+ To enable login with Twtter you first have to create an application in the
+ <ulink url="https://dev.twitter.com/apps">Twitter Developer Console</ulink>. Then you need to copy
+ the consumer key and secret into the Keycloak Admin Console.
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Log in to the <ulink url="https://dev.twitter.com/apps">Twitter Developer Console</ulink>. Click the
+ <literal>Create a new application</literal> button. Use any value for <literal>Name</literal>,
+ <literal>Description</literal> and <literal>Website</literal> you want. Insert the social callback url
+ in <literal>Callback URL</literal>. Twitter doesn't allow <literal>localhost</literal> in the redirect URI,
+ so if you are testing on a local server replace <literal>localhost</literal> with <literal>127.0.0.1</literal>.
+ Twitter also restricts connection to TLS/SSL connections only, this means that you have to use HTTPS to
+ access Keycloak in order to log in via Twitter. Then click <literal>Create your Twitter application</literal>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Now click on <literal>Settings</literal> and tick the box <literal>Allow this application to be used to Sign in with Twitter</literal>,
+ then click on <literal>Update this Twitter application's settings</literal>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Now click <literal>Details</literal>. Copy <literal>Consumer key</literal> and <literal>Consumer secret</literal> from the
+ <ulink url="https://dev.twitter.com/apps">Twitter Developer Console</ulink> into the settings
+ page in the Keycloak Admin Console as the <literal>Key</literal> and <literal>Secret</literal>. Then click
+ <literal>Save</literal> in the Keycloak Admin Console to enable login with Twitter.
+ </para>
+ </listitem>
+ </orderedlist>
+</section>
\ No newline at end of file
diff --git a/docbook/reference/en/images/email-simple-example.png b/docbook/reference/en/images/email-simple-example.png
new file mode 100644
index 0000000..9c341e2
Binary files /dev/null and b/docbook/reference/en/images/email-simple-example.png differ
pom.xml 2(+1 -1)
diff --git a/pom.xml b/pom.xml
index 91fd676..cfed889 100755
--- a/pom.xml
+++ b/pom.xml
@@ -269,7 +269,7 @@
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
- <version>3.0.3</version>
+ <version>3.0.5</version>
</dependency>
<!-- QR Code Generator -->
diff --git a/social/facebook/src/main/java/org/keycloak/social/facebook/FacebookProvider.java b/social/facebook/src/main/java/org/keycloak/social/facebook/FacebookProvider.java
index ac9bc86..8b911b2 100755
--- a/social/facebook/src/main/java/org/keycloak/social/facebook/FacebookProvider.java
+++ b/social/facebook/src/main/java/org/keycloak/social/facebook/FacebookProvider.java
@@ -44,9 +44,12 @@ public class FacebookProvider implements SocialProvider {
public AuthRequest getAuthUrl(SocialProviderConfig config) throws SocialProviderException {
String state = UUID.randomUUID().toString();
+ String redirectUri = config.getCallbackUrl();
+ redirectUri = redirectUri.replace("//localhost", "//127.0.0.1");
+
return AuthRequest.create(state, AUTHENTICATION_ENDPOINT_URL).setQueryParam("client_id", config.getKey())
.setQueryParam("response_type", DEFAULT_RESPONSE_TYPE).setQueryParam("scope", DEFAULT_SCOPE)
- .setQueryParam("redirect_uri", config.getCallbackUrl()).setQueryParam("state", state).setAttribute("state", state).build();
+ .setQueryParam("redirect_uri", redirectUri).setQueryParam("state", state).setAttribute("state", state).build();
}
@Override
diff --git a/social/twitter/src/main/java/org/keycloak/social/twitter/TwitterProvider.java b/social/twitter/src/main/java/org/keycloak/social/twitter/TwitterProvider.java
index 8f7a508..b3b07db 100755
--- a/social/twitter/src/main/java/org/keycloak/social/twitter/TwitterProvider.java
+++ b/social/twitter/src/main/java/org/keycloak/social/twitter/TwitterProvider.java
@@ -42,12 +42,15 @@ public class TwitterProvider implements SocialProvider {
}
@Override
- public AuthRequest getAuthUrl(SocialProviderConfig request) throws SocialProviderException {
+ public AuthRequest getAuthUrl(SocialProviderConfig config) throws SocialProviderException {
try {
Twitter twitter = new TwitterFactory().getInstance();
- twitter.setOAuthConsumer(request.getKey(), request.getSecret());
+ twitter.setOAuthConsumer(config.getKey(), config.getSecret());
+
+ String redirectUri = config.getCallbackUrl();
+ redirectUri = redirectUri.replace("//localhost", "//127.0.0.1");
- RequestToken requestToken = twitter.getOAuthRequestToken(request.getCallbackUrl());
+ RequestToken requestToken = twitter.getOAuthRequestToken(redirectUri);
return AuthRequest.create(requestToken.getToken(), requestToken.getAuthenticationURL())
.setAttribute("token", requestToken.getToken()).setAttribute("tokenSecret", requestToken.getTokenSecret())