22 srpna 2005

Knowledge base:Web Service Description Language - WSDL

WSDL is XML document which describes the web service. Specification is at http://www.w3.org/TR/wsdl. It consists of following parts

Type definition


<types>
<xsd:schema xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="p0" nillable="true" type="xsd:string"/>
<xsd:element name="string_Response" nillable="true" type="xsd:string"/>
</xsd:schema>
</types>

which defines 'p0' element and 'string_Response', both could contain any string.

Message definition

<message name="HelloService_hello_Request_Soap">
<part element="ns0:p0" name="p0">
</message>
<message name="HelloService_hello_Response_Soap">
<part element="ns0:string_Response" name="response"/>
</message>

This defines two types of messages. The part element attribute refers to the type definition of 'p0' and 'string_Response' elements defined in types section.

Port definition

<porttype name="HelloService">
<operation name="hello" parameterorder="p0">
<input message="tns:HelloService_hello_Request_Soap"/>
<output message="tns:HelloService_hello_Response_Soap"/>
</operation>
</porttype>

This defines the set of abstract operations and the abstract messages involved. message attribute refers to the previously defined 'messageHelloService_hello_Request_Soap' and 'HelloService_hello_Response_Soap' from message section.

binding definition

<binding name="HelloService" type="tns:HelloService">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="hello">
<soap:operation
style="document"/>
<input>
<soap:body parts="p0" use="literal"/>
</input>
<output>
<soap:body parts="response" use="literal"/>
</output>
</operation>
</binding>

This defines the message format and protocol details. The "document" style is used (also "rpc" is an option) and literal style in message body is used (also "encoded" is an option). An operation element specifies binding information for the operation with the same name within the portType.

Service definition

<service name="HelloService">
<port binding="tns:HelloService" name="HelloService">
<soap:address location="urn:unknown-location-uri"/>
</port>
</service>
Service groups ports. Each port defines an individual endpoint. Port with name "HelloService" refers to "HelloService" binding in 'binding' attribute.

17 srpna 2005

Knowledge base: Java Authentication and Authorization Service (JAAS)



JAAS is an API that enables Java applications to access authentication and access control services without being tied to those services.

Typically an application creates JAAS LoginContext, tell to use Login Module which is associated with given entry name and put the callback handler which could be used by LoginModule to retrieve other information e.g. from user like 'user name', 'password', 'confirmation'.

JAAS specification, documentation etc at http://java.sun.com/products/jaas/

JAAS authentication tutorial provided at http://java.sun.com/j2se/1.4.2/docs/guide/security/jgss/tutorials/AcnOnly.html#AcnFullCode

JAAS authorization tutorial provided at http://java.sun.com/j2se/1.4.2/docs/guide/security/jgss/tutorials/AcnAndAzn.html

Knowledge base: Lightweight Directory Access Protocol (LDAP)

LDAP is protocol mostly used to interchange information about user/login names/emails. Complex definition with links to RFC at wikipedia http://en.wikipedia.org/wiki/LDAP

LDAP provider (directory) is typically database of users/groups. Examples of providers: MS Active Directory, Sun ONE Directory Server, IBM Tivoli server

LDAP client can communicate with LDAP provider and can ask for authentication and according the result returned it could decide what to do. LDAP client can retrieve list of other users/groups.

LDAP client can connect (bind) to LDAP provider using host, port login distinguished name (DN) and password - login DN and password could be empty if LDAP provider allows anonymous bind. Other anonymous operation could be done such a list of users in LDAP etc.

Java program can access to LDAP via JNDI API http://java.sun.com/products/jndi/ or via any other libraries e.g. OpenLDAP http://www.openldap.org/jldap/