This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var passport = require('passport'); | |
var saml = require('passport-saml').Strategy; | |
// saml strategy for passport | |
var strategy = new saml( | |
{ | |
entryPoint: <provide SAML entry point url : https://localhost:9443/samlsso>, | |
issuer: <provide SAML issuer name : SampleExpressApp>, | |
protocol: <provide the protocol used : http://>, | |
logoutUrl: <provide the logout url : https://localhost:9443/samlsso> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config(); | |
var path = require('path'); | |
var fs = require('fs'); | |
var express = require('express'); | |
var session = require('express-session'); | |
var passport = require('passport'); | |
var saml = require('passport-saml').Strategy; | |
var bodyParser = require('body-parser'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "expresssaml", | |
"version": "1.0.0", | |
"description": "Express Application with SAML SSO", | |
"main": "server.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "athiththan11", | |
"homepage": "https://github.com/athiththan11/Passport-SAML-WSO2", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component( | |
name = "com.sample.athiththan.shopper.internal.service", | |
immediate = true | |
) | |
public class ShopperServiceComponent { | |
private static final Logger LOGGER = Logger.getLogger(ShopperServiceComponent.class.getName()); | |
private static FactFabricator fabricator; | |
@Activate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FactShopper { | |
private static final Logger LOGGER = Logger.getLogger(FactShopper.class.getName()); | |
public void printFacts() { | |
LOGGER.info("\n\nOSGI Shopper :: Print Facts retrieved from FactFabricator :: " | |
+ ShopperServiceComponent.getFactProducer().getSimpleFact().toString() + "\n"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component(name = "com.sample.athiththan.fabricator.internal.service", immediate = true) | |
public class FabricatorServiceComponent { | |
private static final Logger LOGGER = Logger.getLogger(FabricatorServiceComponent.class.getName()); | |
@Activate | |
protected void activate(ComponentContext context) { | |
/** | |
* create a new instance inside the activate method and register the service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FactFabricator { | |
private Fact fact = new Fact(System.getProperty("user.name"), System.getProperty("os.name")); | |
private static final Logger LOGGER = Logger.getLogger(FactFabricator.class.getName()); | |
public Fact getSimpleFact() { | |
LOGGER.info("OSGI Fabricator :: Retrieving Simple Fact from FactFabricator Class"); | |
return fact; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Fact { | |
private String username; | |
private String os; | |
public Fact(String username, String os) { | |
this.setUsername(username); | |
this.setOs(os); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.name.13=defectivePasswordValidator | |
defectivePasswordValidator.subscription.1=PRE_UPDATE_CREDENTIAL | |
defectivePasswordValidator.subscription.2=PRE_UPDATE_CREDENTIAL_BY_ADMIN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DefaultDefectivePasswordValidator implements DefectivePasswordValidator { | |
private static List<String> crackedPasswords = new ArrayList<>(); | |
private static DefaultDefectivePasswordValidator dPasswordValidator = new DefaultDefectivePasswordValidator(); | |
private static final Logger log = LoggerFactory.getLogger(DefaultDefectivePasswordValidator.class); | |
private DefaultDefectivePasswordValidator() { | |
} |