Skip to content

Instantly share code, notes, and snippets.

TID: [-1] [] [2017-03-09 00:39:46,956] DEBUG
{org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-26 >> "POST /subscriber/v1.0.0/* HTTP/1.1[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [-1] [] [2017-03-09 00:39:46,957] DEBUG
{org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-26 >> "Host: md-bdadev-127.verizon.com:7443[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [-1] [] [2017-03-09 00:39:46,957] DEBUG
{org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-26 >> "Content-Length: 345[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [-1] [] [2017-03-09 00:39:46,957] DEBUG
{org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-26 >> "Accept: application/json[\r][\n]" {org.apache.synapse.transport.http.wire}
TID: [-1] [] [2017-03-09 00:39:46,957] DEBUG
{org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-26 >> "Accept-Encoding: gzip, deflate, br[\r][\n]" {org.apache.synapse.transport.http.wir
@Override
public boolean doAuthenticate(String userName, Object credential) throws UserStoreException {
if (CarbonConstants.REGISTRY_ANONNYMOUS_USERNAME.equals(userName)) {
log.error("Anonymous user trying to login");
return false;
}
Connection dbConnection = null;
ResultSet rs = null;
package org.wso2.sample.user.store.manager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.CarbonConstants;
import org.wso2.carbon.user.core.UserRealm;
import org.wso2.carbon.user.core.UserStoreException;
import org.wso2.carbon.user.core.claim.ClaimManager;
import org.wso2.carbon.user.core.jdbc.JDBCRealmConstants;
import org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager;
PHNhbWwyOkFzc2VydGlvbiBJRD0iXzQ4ZWM0N2ViNjViODUwMGE0NTQyM2RjOGYxOWI5OGExIiBJc3N1ZUluc3RhbnQ9IjIwMTctMDMtMDJUMjE6MDQ6MzYuNTI5WiIgVmVyc2lvbj0iMi4wIiB4bWxuczpzYW1sMj0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgeG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIj48c2FtbDI6SXNzdWVyIEZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOm5hbWVpZC1mb3JtYXQ6ZW50aXR5Ij5sb2NhbGhvc3Q8L3NhbWwyOklzc3Vlcj48ZHM6U2lnbmF0dXJlIHhtbG5zOmRzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjIj4NCjxkczpTaWduZWRJbmZvPg0KPGRzOkNhbm9uaWNhbGl6YXRpb25NZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzEwL3htbC1leGMtYzE0biMiLz4NCjxkczpTaWduYXR1cmVNZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjcnNhLXNoYTEiLz4NCjxkczpSZWZlcmVuY2UgVVJJPSIjXzQ4ZWM0N2ViNjViODUwMGE0NTQyM2RjOGYxOWI5OGExIj4NCjxkczpUcmFuc2Zvcm1zPg0KPGRzOlRyYW5zZm9ybSBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNlbnZlbG9wZWQtc2lnbmF0dXJlIi8%2BDQo8ZHM6VHJhbnNmb3JtIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8xMC94bWwtZXhjLWMxNG4jIj48ZW
<saml2:Assertion ID="_fc341124bde8827bb6e3691410dd4d52" IssueInstant="2017-03-03T04:28:18.952Z" Version="2.0" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"><saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">localhost</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#_fc341124bde8827bb6e3691410dd4d52">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
How to prepare SAML assertion for SAML Bearer Grant Type,
1. Copy the encoded SAML Response from either SAML Tracer or logs (DON'T copy from the XML view of SAML Tracer as it does some formatting which result in signature verification failure)
2. Go to https://www.base64encode.org/ and DECODE the SAML Response.
3. Copy the <saml2:Assertion> part
4. Go to https://www.base64encode.org/ and ENCODE the SAML Assertion you copied in #3.
5. Then you need URL encode the encoded string you got in #4. You can use https://www.samltool.com/url.php for that.
Important Points Regarding the SAML Assertion
<datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration">
<providers>
<provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider>
</providers>
<datasources>
<datasource>
<name>WSO2_CARBON_DB</name>
<description>The datasource used for registry- local</description>
@mefarazath
mefarazath / master-datasources.xml
Last active February 16, 2017 18:06
IS 5.3.0 as Key Manager master-datasources.xml sample
<datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration">
<providers>
<provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider>
</providers>
<datasources>
<datasource>
<name>WSO2_CARBON_DB</name>
<description>The datasource used for registry- local</description>
<jndiConfig>
<name>jdbc/WSO2CarbonDB</name>
<!--
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
[2017-02-08 22:30:00,097] ERROR {org.wso2.carbon.analytics.spark.core.CarbonAnalyticsProcessorService} - Error while executing query : CREATE TEMPORARY TABLE isSessionAnalyticsPerMinute USING CarbonAnalytics OPTIONS (tableName "org_wso2_is_analytics_stream_SessionStatPerMinute", schema "meta_tenantId INT -i, bucketId LONG, bucketStart LONG -i, bucketEnd LONG -i, year INT, month INT, day INT, hour INT, minute INT, activeSessionCount LONG, newSessionCount LONG, terminatedSessionCount LONG, _timestamp LONG -i", primaryKeys "meta_tenantId, bucketId, bucketStart, bucketEnd", incrementalParams "isSessionAnalyticsPerHour, HOUR", mergeSchema "false")
org.wso2.carbon.analytics.spark.core.exception.AnalyticsExecutionException: Exception in executing query CREATE TEMPORARY TABLE isSessionAnalyticsPerMinute USING CarbonAnalytics OPTIONS (tableName "org_wso2_is_analytics_stream_SessionStatPerMinute", schema "meta_tenantId INT -i, bucketId LONG, bucketStart LONG -i, bucketEnd LONG -i, year INT, month INT, day INT,