Skip to content

Instantly share code, notes, and snippets.

@tecsyscom
tecsyscom / App.js
Created April 14, 2017 14:44
component App with ES6 or not with ES6
import React from 'react';
const App = () => (
<div>
<AddTodo />
<VisibleTodoList />
<Footer />
</div>
)
//or
@tecsyscom
tecsyscom / component.js
Last active April 14, 2017 14:59
no ES6
import React from 'react';
var SomeMixin = {
doSomething() {
}
};
const App = React.createClass({
getInitialState: function() {
@tecsyscom
tecsyscom / configStore.js
Created April 14, 2017 16:03
configstore for redux
import { createStore, applyMiddleware } from 'redux'
import thunkMiddleware from 'redux-thunk'
import createLogger from 'redux-logger'
import rootReducer from './reducers'
const loggerMiddleware = createLogger()
export default function configureStore(preloadedState) {
return createStore(
rootReducer,
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="https://fb.me/react-0.14.0.min.js"></script>
<script src="https://fb.me/react-dom-0.14.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.5.2/redux.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-redux/4.4.5/react-redux.min.js"></script>
<script src="https://npmcdn.com/xstream@9.0.0/dist/xstream.min.js"></script>
[INFO]
[INFO] --- maven-shade-plugin:2.3:shade (default) @ keycloak-admin-cli ---
[INFO] Including org.jboss.aesh:aesh:jar:0.66.15 in the shaded jar.
[INFO] Including org.fusesource.jansi:jansi:jar:1.11 in the shaded jar.
[INFO] Including org.keycloak:keycloak-core:jar:3.1.0.CR1-SNAPSHOT in the shaded jar.
[INFO] Including org.keycloak:keycloak-common:jar:3.1.0.CR1-SNAPSHOT in the shaded jar.
[INFO] Including org.bouncycastle:bcprov-jdk15on:jar:1.52 in the shaded jar.
[INFO] Including org.bouncycastle:bcpkix-jdk15on:jar:1.52 in the shaded jar.
[INFO] Including com.fasterxml.jackson.core:jackson-core:jar:2.5.4 in the shaded jar.
[INFO] Including com.fasterxml.jackson.core:jackson-databind:jar:2.5.4 in the shaded jar.
at org.keycloak.adapters.saml.profile.AbstractSamlAuthenticationHandler.handleLoginResponse(AbstractSamlAuthenticationHandler.java:360)
at org.keycloak.adapters.saml.profile.AbstractSamlAuthenticationHandler.handleSamlResponse(AbstractSamlAuthenticationHandler.java:213)
at org.keycloak.adapters.saml.profile.webbrowsersso.SamlEndpoint.handle(SamlEndpoint.java:44)
at org.keycloak.adapters.saml.SamlAuthenticator.authenticate(SamlAuthenticator.java:48)
at org.keycloak.adapters.saml.undertow.AbstractSamlAuthMech.authenticate(AbstractSamlAuthMech.java:115)
at io.undertow.security.impl.SecurityContextImpl$AuthAttempter.transition(SecurityContextImpl.java:233)
at io.undertow.security.impl.SecurityContextImpl$AuthAttempter.transition(SecurityContextImpl.java:250)
at io.undertow.security.impl.SecurityContextImpl$AuthAttempter.access$100(SecurityContextImpl.java:219)
at io.undertow.security.impl.SecurityContextImpl.attemptAuthentication(SecurityContextImpl.java:121)
at io.undertow.security.impl.SecurityContext
lient_id=customer-portal&redirect_uri=http%3A%2F%2Flocalhost%3A8082%2Fcustomer-portal&state=c44f4753-9c18-416d-be48-d3e82af5d64e&login=true&scope=openid
20:15:21,519 ERROR [org.keycloak.adapters.BearerTokenRequestAuthenticator] Failed to verify token
org.keycloak.common.VerificationException: Token type is incorrect. Expected 'Bearer' but was 'Refresh'
at org.keycloak.TokenVerifier.verify(TokenVerifier.java:160)
at org.keycloak.RSATokenVerifier.verify(RSATokenVerifier.java:89)
at org.keycloak.adapters.rotation.AdapterRSATokenVerifier.verifyToken(AdapterRSATokenVerifier.java:56)
at org.keycloak.adapters.rotation.AdapterRSATokenVerifier.verifyToken(AdapterRSATokenVerifier.java:37)
at org.keycloak.adapters.BearerTokenRequestAuthenticator.authenticateToken(BearerTokenRequestAuthenticator.java:87)
at org.keycloak.adapters.BearerTokenRequestAuthenticator.authenticate(BearerTokenRequestAuthenticator.java:82)
at org.keycloak.adapters.RequestAuthenticator.authenticate(RequestAuthenticator.java:68)
@tecsyscom
tecsyscom / gist:54e2380ba35ee66d73ad62b5c05a6adb
Created April 17, 2017 07:38
fail to install keycloak app in wildfly
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.700 s
[INFO] Finished at: 2017-04-17T15:33:51+08:00
[INFO] Final Memory: 27M/242M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.1.0.Final:deploy (default-cli) on project examples-basicauth: Execution default-cli of goal org.wildfly.plugins:wildfly-maven-plugin:1.1.0.Final:deploy failed: WFLYCTL0379: System boot is in process; execution of remote management operations is not currently available -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
@tecsyscom
tecsyscom / gist:804100a978d4168a355678d723f8a20a
Created April 18, 2017 04:32
for following multiline logs
multiline.pattern: '^[[:space:]]'
multiline.negate: false
multiline.match: after
multiline.pattern: '^[[:space:]]+|^Caused by:'
multiline.negate: false
multiline.match: after
// for following multiline logs
(Server started, use Ctrl+D to stop and go back to the console...)
[warn] - org.pac4j.core.client.direct.AnonymousClient - AnonymousClient is an advanced feature: be careful when using it to avoid any security issue!
[warn] - org.pac4j.core.client.direct.AnonymousClient - AnonymousClient is an advanced feature: be careful when using it to avoid any security issue!
[debug] - org.pac4j.play.filters.SecurityFilter - No authentication needed for /
[debug] - org.pac4j.play.java.SecureAction - String param: clients: AnonymousClient
[debug] - org.pac4j.play.java.SecureAction - String param: authorizers: csrfToken
[debug] - org.pac4j.play.java.SecureAction - Boolean param: multiProfile: false
[debug] - org.pac4j.core.engine.DefaultSecurityLogic - === SECURITY ===
[debug] - org.pac4j.core.engine.DefaultSecurityLogic - url: http://localhost:9000/