Páginas

sexta-feira, 13 de maio de 2016

[Jasper] - Habilitar Login de Senha Criptografada


Gerar KeyTool  para Servidor do Jasper:

keytool -genkey -alias jasper -keyalg RSA -keysize 1024 -keypass jasper123 -keystore keystore.jks -storepass jasper123

1.            Configure login encryption as described in the JasperReports Server Administrator Guide. Specify static key encryption by setting encryption.dynamic.key to false and configure the keystore as described.
2.            Once the server is restarted, log into the server to generate the static key.
3.            Open the following URL: http://example.com:8080/jasperserver/encrypt.html.
4.            Enter the password that you want to encrypt, for example joeuser, then click Encrypt. The script on this page will use the public key to encrypt the password.
5.            Paste the encrypted password into the URL instead of the plain text password (log out of the server to test this):
http://example.com:8080/jasperserver/flow.html?_flowId=homeFlow&j_userna...
6.            Use the URL with the encrypted password to share a report.

Diretório da Webapp Jasper Keystore:
C:\Jaspersoft\jasperreports-server-cp-5.6.1\apache-tomcat\webapps\jasperserver\WEB-INF\classes

Colocar o arquivo gerado pelo Keytool nesta pasta: keystore.jks

Diretório da Webapp Jasper Configuração:
C:\Jaspersoft\jasperreports-server-cp-5.6.1\apache-tomcat\webapps\jasperserver\WEB-INF\classes\esapi
Alterar o arquivo: security-config.properties

-- parâmetros alterados –
# Turns encryption of encryption.param's defined below on or off.
encryption.on=true

# ENCRYPTION CONFIGURATION
# encryption.dynamic.key=true means that the 1 key will be generated per every single request.
# If 'false', the key will be drawn from a keystore (see KEYSTORE group below)
encryption.dynamic.key=false
-------------------------------------------------------------------
# keystore.location can be on a classpath or an external-to-webapp file
keystore.location=keystore.jks
# password to verify keystore integrity
keystore.password=jasper123
# key pair alias used to retrieve correct key from keystore
keystore.key.alias=jasper
# keystore.key.alias's password
keystore.key.password=jasper123
-----------------------------------------------------------------------


terça-feira, 10 de maio de 2016

[Oracle] - Informações de Data e Hora


Neste artigo estarei disponibilizando uma consulta para facilitar a utilização de informações de Data e Hora no Oracle database:

SELECT extract(YEAR FROM SYSDATE) AS ano,
       extract(MONTH FROM SYSDATE) AS mes,
       extract(DAY FROM SYSDATE) AS dia,
       EXTRACT(HOUR FROM NUMTODSINTERVAL(SYSDATE - trunc(SYSDATE), 'DAY')) AS hora,
       extract(minute FROM systimestamp) AS minuto,
       trunc(extract(SECOND FROM systimestamp)) AS segundo,
       SYSDATE AS data_hora
FROM   dual;


Espero que essa dica, ajudem outros profissionais que trabalham com Oracle, facilitando o dia-a-dia.
Graças e Paz sejam com Todos.