Declarative and Programmatic Authentication

SAP NetWeaver AS for Java enables applications to use declarative or programmatic authentication to authenticate users.

  • Declarative authentication (also known as container-based authentication):

    The application container of SAP NetWeaver AS for Java handles authentication. A component running on SAP NetWeaver AS for Java declares protected resources and the desired authentication mechanism in its deployment descriptor. When a protected resource of this component is accessed, the container in which the component runs performs authentication.

  • Programmatic authentication (also known as UME authentication):

    Components running on SAP NetWeaver AS for Java authenticate directly against the user management engine (UME) using the UME API. The component explicitly triggers authentication and afterwards the authentication process is controlled by the authentication framework.

Both declarative and programmatic authentication use login modules and authentication stacks as their underlying technology.

You can configure the authentication policy for both types of applications using declarative or UME programmatic authentication with their deployment descriptors web.xml and web-j2ee-engine.xml.

After deployment, you can change this assignment in SAP NetWeaver Administrator.

Portal applications and iViews have their own implementation of programmatic authentication that includes authentication schemes. The authentication scheme in turn references a login module stack.

Integration

The different types of applications can use different means for defining the login module stack to use in its policy configuration. For more information, see the table below:

Application Type

Type of Authentication

Where is Login Module Stack defined

Web applications

Declarative authentication

Declared in the web.xml deployment descriptor of the Web application.

Web applications

Programmatic authentication

This depends on how the application is programmed. Applications can define an authentication scheme in their calls to the API. By default, if they do not define an authentication scheme, these applications use the login module stack referenced by default in the authentication schemes file.

Web Dynpro applications

Programmatic authentication

For more information, see the security documentation for Web Dynpro Java.

Portal iViews

Programmatic authentication

An iView property defines which authentication scheme the iView uses. The authentication scheme references a login module stack.

Declarative and programmatic authentication are integrated so that if an application uses programmatic authentication to authenticate its users, the container where it runs on SAP NetWeaver AS for Java is also aware that the users are authenticated. Inversely, if an application uses declarative authentication to authenticate its users, UME is also aware that the users are authenticated. Calls to the APIs of both the container and UME return the authenticated user.