License: Apache-2.0

Language: Java

Carbon Security Connector JDBC

Carbon Security project provides authentication and authorization implementation for carbon products based on JAAS.


  • JAAS based authentication.
  • JAAS based authorization.
  • Built in login modules
    • Username Password login module
    • JWT login module
    • SAML login module
  • Mechanism to plug-in custom Login modules, callback handlers in an OSGi environment.

Getting Started


Following are the steps to authenticate a user with an in-built login module.

Configure carbon-jaas.config file at `to specify the login module to be used for authentication. For example if you wish to use the Username Password login module,carbon-jaas.config` should look like below.

CarbonSecurityConfig {
   org.wso2.carbon.security.jaas.modules.UsernamePasswordLoginModule required;

Similarly for JWT and SAML login modules, the following fully qualified class names can be used.

  • org.wso2.carbon.security.jaas.modules.JWTLoginModule
  • org.wso2.carbon.security.jaas.modules.SAML2LoginModule

The following code snippet shows how to perfrom a login using JAAS.

CallbackHandler callbackHandler = new CarbonCallbackHandler(httpRequest);
LoginContext loginContext;
try {
    loginContext = new LoginContext("CarbonSecurityConfig", callbackHandler);
} catch (LoginException e) {
    //logic if initializing login context fails.
try {
} catch (LoginException e) {
    //logic if login fails.

## Download

Use Maven snippet:

Snapshot Releases

Use following Maven repository for snapshot versions of Carbon Security.

    <name>WSO2 Snapshot Repository</name>

Released Versions

Use following Maven repository for released stable versions of Carbon Security.

    <name>WSO2 Releases Repository</name>

Building From Source

Clone this repository first (git clone https://github.com/wso2/carbon-security.git) and use Maven install to build mvn clean install.

Contributing to Carbon Security Project

Pull requests are highly encouraged and we recommend you to create a JIRA to discuss the issue or feature that you are contributing to.


Carbon Security is available under the Apache 2 License.


Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.

Project Statistics

Sourcerank 3
Repository Size 59.6 KB
Stars 0
Forks 0
Watchers 3
Open issues 0
Dependencies 23
Contributors 3
Tags 0
Last updated
Last pushed

Top Contributors See all

Jayanga Kaushalya Omindu Rathnaweera Thanuja Lakmal

Something wrong with this page? Make a suggestion

Last synced: 2016-05-28 08:50:30 UTC

Login to resync this repository