Archive for
January, 2008
Posted by resmo on January 15, 2008
under Java, Networking, OSS
Hier ist ein Stück Javacode mit dem man eine LDAP Authentifizierung realisieren kann:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
| import javax.naming.*;
import javax.naming.directory.*;
import java.util.Hashtable;
/**
* Demonstrates how to create an initial context to an LDAP server
* using simple authentication.
*/
class Simple {
public static void main(String[] args) {
Hashtable authEnv = new Hashtable(11);
String userName = "johnlennon";
String passWord = "sushi974";
String base = "ou=People,dc=example,dc=com";
String dn = "uid=" + userName + "," + base;
String ldapURL = "ldap://ldap.example.com:389";
authEnv.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
authEnv.put(Context.PROVIDER_URL, ldapURL);
authEnv.put(Context.SECURITY_AUTHENTICATION, "simple");
authEnv.put(Context.SECURITY_PRINCIPAL, dn);
authEnv.put(Context.SECURITY_CREDENTIALS, passWord);
try {
DirContext authContext = new InitialDirContext(authEnv);
System.out.println("Authentication Success!");
} catch (AuthenticationException authEx) {
System.out.println("Authentication failed!");
} catch (NamingException namEx) {
System.out.println("Something went wrong!");
namEx.printStackTrace();
}
}
} |
Tags: ldap
Posted by resmo on January 15, 2008
under Unkategorisiert
Um sein Handy zu pimpen und nicht allzuviel Kohle auszugeben, kann man sich auf mjelly.com [1] einige nette Klingeltöne herunterladen.
(Natürlich braucht man zum Download nicht unbedingt sein Handy zu benutzen, man kann den Link auch in die Adressliste [2] des Browsers reinkopieren).
[1] http://mjelly.com/tags/ringtone
[2] http://m.mjelly.com/get
Posted by resmo on January 15, 2008
under OSS, PHP, Security
Etwas aus der Fundgrube:
HTML Purifier [1] is a standards-compliant
HTML filter library written in
PHP. HTML Purifier will not only remove all malicious
code (better known as XSS) with a thoroughly audited,
secure yet permissive whitelist,
it will also make sure your documents are
standards compliant, something only achievable with a
comprehensive knowledge of W3C’s specifications.
Tired of using BBCode due to the current landscape of deficient or
insecure HTML filters? Have a
WYSIWYG editor but never been able to use it? Looking
for high-quality, standards-compliant, open-source components for that
application you’re building? HTML Purifier is for you!
[1] http://htmlpurifier.org/
Posted by resmo on January 11, 2008
under GNU/Linux, Networking, OSS, Security
Der 24C3 [2] ist schon eine Weile her, aber erst jetzt bin ich dazu gekommen, mir ein paar Vorträge anzusehen. Besonders sehenswert finde den Vortrag [2] über die Geschichte des OS X Kernels, nett und interessant vorgetragen.
Auch den Vortrag [3] über “Portscanning Improved” find ich gelungen.
[1] http://berlin.ccc.de
[2] inside_the_macosx_kernel.mkv.torrent
[3] port_scanning_improved.mkv.torrent