I have successfully installed Openrdf Repository (sesame 2.3.2) and Openrdf workbench however I do not know how to set up a user and a password to protect Openrdf workbench. I suppose that there is --somewhere -- a configuration file.
Can somebody give me a hint how to create a user and set up a password for openrdf workbench?
I believe you need to password protect at the servlet container level. Are you using Tomcat? Here's what I used to set up basic authentication with Tomcat 6:
web.xml
<security-constraint>
<web-resource-collection>
<web-resource-name>Sesame Workbench</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>sesame-user</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Sesame Workbench</realm-name>
</login-config>
<security-role>
<description>The role required for Sesame workbench</description>
<role-name>sesame-user</role-name>
</security-role>
tomcat-users.xml
<role rolename="sesame-user"/>
<user username="workbench" password="workbench" roles="sesame-user"/>
Related
I just installed the Custom Security extension on my Power BI Report Server
I registered through the web page into the UserAccounts database but I don't know how I can add the first admin user (no ActiveDirectory) in the internal Report Server database.
Could you please help me with this?
Thank you in advance.
I guess you have used Microsoft Github page for CustomSecuritySample. If so, the user which is considered as admin is defined in RSReportServer.config file, located in the \ReportServer directory:
<Security>
<Extension Name="Forms" Type="Microsoft.Samples.ReportingServices.CustomSecurity.Authorization, Microsoft.Samples.ReportingServices.CustomSecurity" >
<Configuration>
<AdminConfiguration>
<UserName>myuser</UserName>
</AdminConfiguration>
</Configuration>
</Extension>
</Security>
In the above example, myuser is considered admin.
I was able to start the Broadleaf demo application from the provided scripts adminstart.sh and startsite.sh. I was also able to change the database to MySQl. However, I do not understand how to create a war that can run on my Tomcat instance.
I see that broadleaf does things differently as compared to the common approach. Usually I put the context values into the file application-context. xml that is referred in web.xml. There is no need for modifying Tomcat context.xml. The example is
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/application-context.xml</param-value>
</context-param
In the broadleaf configuration there are several context parameters
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>blAdmin.root</param-value>
</context-param>
<context-param>
<param-name>patchConfigLocation</param-name>
<param-value>
classpath:/bl-open-admin-contentClient-applicationContext.xml
classpath:/bl-open-admin-contentCreator-applicationContext.xml
classpath:/bl-admin-applicationContext.xml
classpath:/bl-cms-contentClient-applicationContext.xml
classpath:/bl-cms-contentCreator-applicationContext.xml
classpath*:/blc-config/admin/bl-*-applicationContext.xml
classpath:/applicationContext.xml
classpath:/applicationContext-email.xml
/WEB-INF/applicationContext-datasource.xml
/WEB-INF/applicationContext-admin-security.xml
/WEB-INF/applicationContext-admin-filter.xml
/WEB-INF/applicationContext-admin.xml
</param-value>
</context-param>
<context-param>
<param-name>shutdownHookMethod</param-name>
<param-value>forceFlush</param-value>
</context-param>
Plus in addition in web.xml:
<!-- Initialize spring mvc -->
<servlet>
<servlet-name>admin</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:/applicationContext-servlet-open-admin.xml
classpath:/applicationContext-servlet-admin.xml
classpath:/applicationContext-servlet-cms-contentClient.xml
classpath:/applicationContext-servlet-cms-contentCreator.xml
classpath:/bl-menu-admin-applicationContext-servlet.xml
classpath*:/blc-config/admin/bl-*-admin-applicationContext-servlet.xml
/WEB-INF/applicationContext-servlet-admin.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
The result is that the Tomcat instance contains context.xml in the conf directory that provides database pool configuration:
What is the best way of utilizing broadleaf in my application?
Configuration
Put your MySQL JDBC driver to tomcat7/lib folder
Open web.xml for both, site and admin modules in DemoSite
Add the following code in both web.xml
<resource-ref>
<description>WEB</description>
<res-ref-name>jdbc/web</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description>STORAGE</description>
<res-ref-name>jdbc/storage</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description>SECURE</description>
<res-ref-name>jdbc/secure</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Open cmd prompt for windows or command shell for linux
Navigate to your JDK_directory/bin and create keystore for SSL switching
keytool -genkey -alias tomcat -keyalg RSA -storepass password
Open Tomcat7/conf/server.xml
Add the following code to enable SSL switching, just below your default connector port
<Connector
protocol="org.apache.coyote.http11.Http11NioProtocol"
port="8443" maxThreads="200"
scheme="https" secure="true"
SSLEnabled="true"
keystorePass="password"
clientAuth="false"
sslProtocol="TLS"
/>
Open Tomcat7/conf/tomcat-users.xml
Add following
<user username="tomcat" password="password" roles="manager-gui"/>
Populate database.properties with values for your database or
Configure JNDI for tomcat
In your admin or site folder there is file target/tomcat-server-config/context.xml.
Copy this file into tomcat7/conf/
Open this file and replace the following properties with your database values
username="${database.user}" : Replace with your database username (eg. broadleaf)
password="${database.password}" : Replace with your database password
driverClassName="${database.driver}" : Replace with your database classname (eg. org.postgresql.Driver)
url="${database.url}" : Replace with your database URL with database path, port and name. (eg. jdbc:postgresql://localhost:5432/broadleaf)
in your IDE Start Maven project install goal of lifecycle (of entire project or each module)
This will create wars for each module
Start tomcat (run startup.bat/startup.sh in ~/tomcat7/bin/ )
Go to app manager and enter tomcat username and key that you added into tomcat-users.xml
deploy admin and site wars
context path is url mapping (eg. /admin and /demo-site)
XML configuration url is full path to your targets context.xml (eg. ~/target/tomcat-server-conf/context.xml)
WAR directory is full path to your war in target directory
Don't forget to change blPU.hibernate.hbm2ddl.auto in development.properties from create to update (standalone tomcat have trouble to create tables - that's my expirience with postreSQL)
I have mysql master slave configuration and i cant connect to it when i specify two ips. I search for connection string and found http://www.connectionstrings.com/mysql-connector-net-mysqlconnection/
Server=serverAddress1, serverAddress2, serverAddress3;Database=myDataBase;
Uid=myUsername;Pwd=myPassword;
So its looks simple but when i specify my two ips i get error "No such host is known"
I also found https://blogs.oracle.com/MySqlOnWindows/entry/how_to_using_replication_load and tried it but strange thing is that then it much slower. So now i am lost i cant use my replication.
PS. I am not sure if it make sense but i am running that on Azure
You should specify server in specific config section
<configSections>
<section name="MySQL" type="MySql.Data.MySqlClient.MySqlConfiguration, MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
</configSections>
<MySQL>
<Replication>
<ServerGroups>
<Group name="MasterSlave">
<Servers>
<Server name="master" IsMaster="true" connectionstring=" server=<server>;port=<port>;uid=<user>;password=<password>;"/>
<Server name="slave" IsMaster="false" connectionstring=" server=<server>;port=<port>;uid=<user>;password=<password>;"/>
</Servers>
</Group>
</ServerGroups>
</Replication>
</MySQL>
Then use following as a connection string:
"server=MasterSlave;database=sakila;"
Source: https://blogs.oracle.com/MySqlOnWindows/entry/how_to_using_replication_load
I'm trying to connect Openfire with my custom my sql database which I created using Mysql workbench..
I modified openfire.xml file as follow :
<jive>
<adminConsole>
<!-- Disable either port by setting the value to -1 -->
<port>9090</port>
<securePort>9091</securePort>
</adminConsole>
<locale>en</locale>
<!-- Network settings. By default, Openfire will bind to all network interfaces.
Alternatively, you can specify a specific network interfaces that the server
will listen on. For example, 127.0.0.1. This setting is generally only useful
on multi-homed servers. -->
<!--
<network>
<interface></interface>
</network>
-->
<connectionProvider>
<className>org.jivesoftware.database.DefaultConnectionProvider</className>
</connectionProvider>
<database>
<defaultProvider>
<driver>com.mysql.jdbc.Driver</driver>
<serverURL>jdbc:mysql://localhost:3306/openfire_db?rewriteBatchedStatements=true</serverURL>
<username encrypted="true">c130d8786ef86071bcb73f1d8da0eb34f544f389f480f60e</username>
<password encrypted="true">f15df01c5d651451f5f38c29332cf655ff1621d7c0e741ec</password>
<testSQL>select 1</testSQL>
<testBeforeUse>false</testBeforeUse>
<testAfterUse>false</testAfterUse>
<minConnections>5</minConnections>
<maxConnections>25</maxConnections>
<connectionTimeout>1.0</connectionTimeout>
</defaultProvider>
</database>
<setup>true</setup>
<jdbcProvider>
<driver>com.mysql.jdbc.Driver</driver>
<connectionString>jdbc:mysql://localhost/openfire_db?user=root&password=hello</connectionString>
</jdbcProvider>
<provider/>
<jdbcAuthProvider>
<passwordSQL>SELECT plainPassword FROM users WHERE username=?</passwordSQL>
<passwordType>plain</passwordType>
</jdbcAuthProvider>
<jdbcUserProvider>
<loadUserSQL>SELECT name,email FROM users WHERE username=?</loadUserSQL>
<userCountSQL>SELECT COUNT(*) FROM users</userCountSQL>
<allUsersSQL>SELECT username FROM users</allUsersSQL>
<searchSQL>SELECT username FROM users WHERE</searchSQL>
<usernameField>username</usernameField>
<nameField>name</nameField>
<emailField>email</emailField>
</jdbcUserProvider>
</jive>
I get no errors, no warns.. But when I try to login to the admin console I get :
Login failed: make sure your username and password are correct and that you're an admin or moderator.
And in warns:
2015.01.28 11:31:20 org.jivesoftware.admin.LoginLimitManager - Failed admin console login attempt by user from 127.0.0.1
I have in my database table users which has columns : username, plainPassword, encryptedPassword, name, email, creationDate
Thanks.. :)
Problem Solved ^_^.. I needed to add the following to openfire.xml :
<provider>
<auth>
<className>org.jivesoftware.openfire.auth.JDBCAuthProvider</className>
</auth>
<user>
<className>org.jivesoftware.openfire.user.JDBCUserProvider</className>
</user>
<group>
<className>org.jivesoftware.openfire.group.JDBCGroupProvider</className>
</group>
</provider>
and change properties of ofProperty table..
I have an ASP.NET web application written in VB.NET. One part of the application makes an AJAX call to an internal ASMX file which in turn makes a call to a remote web service which is just a single ASMX file. Normally this works fine and has been deployed a couple of times and works fine. One client however, is getting the message from the AJAX call:
The HTTP request is unauthorized with client authentication scheme
'Anonymous'. The authentication header received from the server was
'NTLM’.
I have scoured a large amount of websites trying to fix this but I can’t seem to find any answer that works for me.
I have been unable to replicate the error on my test server, which is the same as the client, Win2003 IIS6.
The remote web service is deployed on Windows 2008 r2 – IIS7.5. The remote service is deployed using ‘Anonymous’ authentication only. The client deployment is set up with Anonymous and ‘Integrated Windows Authentication’. I have tried changing the authentication levels on both implementations but cannot replicate the issue. The closest I have come is when I set the remote service IIS authentication to
The HTTP request is unauthorized with client authentication scheme
'Ntlm'. The authentication header received from the server was ''.
In the web.config file the reference to the remote service is:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="SVCMappingSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://svc.website.com/services/myService.asmx" binding="basicHttpBinding" bindingConfiguration="SVCMappingSoap" contract="SVCMappingService.SVCMappingSoap" name="SVCMappingSoap"/>
</client>
</system.serviceModel>
I have tried changing a number of the setting in the <security> section but still unable to replicate.
I am not sure of your total server setup.
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
</security>
instead of above one please try with below configuration
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm"/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
please go through below links, you can more idea on those and you can change the config based on your requirements:
http://blogs.msdn.com/b/publicsector/archive/2005/10/19/482833.aspx
http://fczaja.blogspot.com/2009/10/http-request-is-unauthorized-with.html
http://ddkonline.blogspot.com/2009/11/fix-http-request-is-unauthorized-with.html
I had to change the default generated
<security mode="Transport"/>
into
<security mode="Transport" >
<transport clientCredentialType="Ntlm"/>
</security>
One more comment for this problem:
If you are not using HTTPS,
<security mode="Transport"/>
is not supported. You can use
<security mode="TransportCredentialOnly">
instead.