Wiki source code of org.clazzes.login.adapter.http
Version 13.1 by christoph_lechleitner@iteg_at on 2013-10-27 11.06:53
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | === {{id name="org.clazzes.login.adapter.http-HTTPLoginAdapter"/}}HTTP Login Adapter === | ||
| 2 | |||
| 3 | The login-service-adapter {{code language="none"}}org.clazzes.login.adapter.http{{/code}} listens for providers of the ##[[DomainPasswordLoginService>>doc:LOGIN.DomainPasswordLoginService implementations and backends.WebHome]]## interface and exports them adapted as a ##[[HttpLoginService>>doc:GWTBASICS.GWT implementations of http-util HttpLoginService.HTTP login service.WebHome]]## (see [[https:~~/~~/svn.clazzes.org/svn/util/trunk/http-util/src/main/java/org/clazzes/util/http/sec/HttpLoginService.java>>url:https://svn.clazzes.org/svn/util/trunk/http-util/src/main/java/org/clazzes/util/http/sec/HttpLoginService.java||shape="rect"]]). | ||
| 4 | |||
| 5 | It is provided as an OSGi bundle, which may be activated by | ||
| 6 | |||
| 7 | (% class="code" %) | ||
| 8 | ((( | ||
| 9 | obr:addurl http:~/~/maven.clazzes.org/repository.xml | ||
| 10 | obr:deploy http-login-adapter | ||
| 11 | ))) | ||
| 12 | |||
| 13 | The maven artifact is: | ||
| 14 | |||
| 15 | (% class="code" %) | ||
| 16 | ((( | ||
| 17 | <groupId>org.clazzes.login</groupId> | ||
| 18 | <artifactId>http-login-adapter</artifactId> | ||
| 19 | ))) | ||
| 20 | |||
| 21 | URL of exported {{code language="none"}}DomainPasswordLoginService{{/code}}: {{code language="none"}}/http-login/<login.mechanism>/login{{/code}} | ||
| 22 | <login.mechanism> beeing i.e. {{code language="none"}}jaas{{/code}} from [[doc:LOGIN.DomainPasswordLoginService implementations and backends.org\.clazzes\.login\.jaas.WebHome]], {{code language="none"}}ldap{{/code}} from [[doc:LOGIN.DomainPasswordLoginService implementations and backends.org\.clazzes\.login\.ldap.WebHome]], {{code language="none"}}http{{/code}} from [[doc:LOGIN.DomainPasswordLoginService implementations and backends.org\.clazzes\.login\.http.WebHome]]. | ||
| 23 | |||
| 24 | Starting with version 1.2.0 of http-login-adapter, the timezone of the user logging in is determined via javascript and propagated to the server as the login time zone, when the configuration parameter {{code language="none"}}doTimeZoneDetection=true{{/code}} is set. The login timezone may be queried using HttpLoginServer.getTimeZone() or ThreadLocalManager.getLoginTimeZone() when using HttpCheckLoginInterceptor of http-aop-util-1.2.0 or later | ||
| 25 | |||
| 26 | === {{id name="org.clazzes.login.adapter.http-URLschemeandparameters"/}}URL scheme and parameters === | ||
| 27 | |||
| 28 | The login time zone and/or login local may be overwritten using URL parameters to the login service like in the following examples: | ||
| 29 | |||
| 30 | |=((( | ||
| 31 | login URL | ||
| 32 | )))|=((( | ||
| 33 | remarks | ||
| 34 | ))) | ||
| 35 | |((( | ||
| 36 | (% class="code" %) | ||
| 37 | ((( | ||
| 38 | /http-login/<login.mechanism>/login?tz=America/Los_Angeles | ||
| 39 | ))) | ||
| 40 | )))|((( | ||
| 41 | login with the browser's default locale and Los Angeles time zone | ||
| 42 | ))) | ||
| 43 | |((( | ||
| 44 | (% class="code" %) | ||
| 45 | ((( | ||
| 46 | /http-login/<login.mechanism>/login?tz=GMT+01:00&locale=fr | ||
| 47 | ))) | ||
| 48 | )))|((( | ||
| 49 | login with a timezone with fixed offset and a french locale. | ||
| 50 | ))) | ||
| 51 | |((( | ||
| 52 | (% class="code" %) | ||
| 53 | ((( | ||
| 54 | /http-login/<login.mechanism>/login?locale=fr-CA | ||
| 55 | ))) | ||
| 56 | )))|((( | ||
| 57 | login with a french canadian locale. | ||
| 58 | ))) | ||
| 59 | |||
| 60 | === {{id name="org.clazzes.login.adapter.http-Testpad"/}}(% style="color: rgb(0,0,0);font-size: 16.0px;line-height: 1.5625;" %)Testpad(%%) === | ||
| 61 | |||
| 62 | There is a small testpad application to play with this adapter. | ||
| 63 | |||
| 64 | It is provided as an OSGi bundle, which may be activated by | ||
| 65 | |||
| 66 | (% class="code" %) | ||
| 67 | ((( | ||
| 68 | obr:addurl http:~/~/maven.clazzes.org/repository.xml | ||
| 69 | obr:deploy http-login-testpad | ||
| 70 | ))) | ||
| 71 | |||
| 72 | The maven artifact is: | ||
| 73 | |||
| 74 | (% class="code" %) | ||
| 75 | ((( | ||
| 76 | <groupId>org.clazzes.login</groupId> | ||
| 77 | <artifactId>http-login-testpad</artifactId> | ||
| 78 | ))) | ||
| 79 | |||
| 80 | === {{id name="org.clazzes.login.adapter.http-Configuration"/}}Configuration === | ||
| 81 | |||
| 82 | The following configuration overview is valid as of version 1.3.0, which will be released around 2013-10-28. | ||
| 83 | |||
| 84 | |=((( | ||
| 85 | Name | ||
| 86 | )))|=((( | ||
| 87 | Description | ||
| 88 | ))) | ||
| 89 | |((( | ||
| 90 | doTimeZoneDetection | ||
| 91 | )))|((( | ||
| 92 | Set to {{code language="none"}}true{{/code}} for multi-time-zone applications. Defaults to {{code language="none"}}false{{/code}}. | ||
| 93 | ))) | ||
| 94 | |((( | ||
| 95 | failureTimeout | ||
| 96 | )))|((( | ||
| 97 | Delay penalty after bad login attempts, in {{code language="none"}}ms{{/code}}. Default to 500. | ||
| 98 | ))) | ||
| 99 | |((( | ||
| 100 | secureCookie | ||
| 101 | )))|((( | ||
| 102 | Wether to flag the session cookie as secure. Defaults to {{code language="none"}}false{{/code}}. | ||
| 103 | Set to {{code language="none"}}true{{/code}} for {{code language="none"}}https{{/code}}-only operations, which is highly recommended. | ||
| 104 | ))) | ||
| 105 | |((( | ||
| 106 | sessionCookie | ||
| 107 | )))|((( | ||
| 108 | Name of session cookie. Defaults to {{code language="none"}}LOGIN_SESSION_ID{{/code}}. | ||
| 109 | ))) | ||
| 110 | |((( | ||
| 111 | sessionTimeout | ||
| 112 | )))|((( | ||
| 113 | Session timeout in minutes. Defaults to {{code language="none"}}180{{/code}} (=3 hours). | ||
| 114 | ))) |