JanusGraph Server XML Configuration - graph-databases

Anyone knows how to configure the username and password for janusgraph server. So any http/socket send to this janusgraph server require authentication.
Thank You

JanusGraph packages TinkerPop's Gremlin Server, so to configure authentication you can simply follow the Gremlin Server's instructions for doing so. The basic steps would be to modify the server yaml file to include the following:
authentication: {
authenticator: org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator,
config: {
credentialsDb: conf/credentials.properties}}
which sets up a "simple" authentication system that uses a local Graph instance configured by conf/credentials.properties to house username/passwords. Obviously, you could write a more advanced Authenticator if you'd like and use that instead - the SimpleAuthenticator is really just a reference implementation to get people started. Here's an example that uses TinkerGraph as the target database for the credentials:
gremlin.graph=org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph
gremlin.tinkergraph.vertexIdManager=LONG
gremlin.tinkergraph.graphLocation=data/credentials.kryo
gremlin.tinkergraph.graphFormat=gryo
but it could obviously be any Graph you wanted to use.
To setup the usernames and passwords in that graph you would need to use the Credentials DSL typically executed as an administration task through the Gremlin Console. You would do something like:
gremlin> :plugin use tinkerpop.credentials
==>tinkerpop.credentials activated
gremlin> graph = ... // create your graph instance for usernames/passwords
...
gremlin> credentials = credentials(graph)
==>CredentialGraph{graph=tinkergraph[vertices:0 edges:0]}
gremlin> credentials.createUser("stephen","password")
==>v[0]
gremlin> credentials.createUser("daniel","better-password")
==>v[3]
gremlin> credentials.createUser("marko","rainbow-dash")
==>v[6]
gremlin> credentials.findUser("marko").properties()
==>vp[password->$2a$04$lBXMnKWtLB...]
==>vp[username->marko]
gremlin> credentials.countUsers()
==>3
gremlin> credentials.removeUser("daniel")
==>1
gremlin> credentials.countUsers()
==>2
Start Gremlin Server with that configuration and authentication should be enabled.
These steps are described in more detail in the TinkerPop reference documentation. I'd suggest that you download Gremlin Server on its own and examine the preconfigured "secure" configuration with an already built "credentials graph" that users TinkerGraph. You can run that example with:
$ bin/gremlin-server.sh conf/gremlin-server-secure.yaml
Take a good look at what's in conf/gremlin-server-secure.yaml and how it ties to the conf/tinkergraph-credentials.properties then make similar changes in your JanusGraph Server configuration. That should get you started.

Related

Authentication with apache solr

Github Link
Missing username and password properties from the solr connector configuration to authenticate with the solr.
Is that possible to authenticate with solr via connector config?
How to pass username n password within the connector config?
Looks like solr.username and solr.password aren't actually used in the connector. The SolrClient is created with a default HttpSolrClient without any credentials in this source file in Github. But MatsLindh's point about embedding username and password in the URL is a good one and I'd have expected it to work.
There's a relevant thread here:
Solr6.3.0 SolrJ API for Basic Authentication
I haven't vetted the last answer in the thread, which doesn't really address the original topic in that post, but it is a concise example of creating a SolrClient with authentication. The SolrClient needs to wrap an underlying HttpClient that provides the basic auth, and the Kafka Solr sink connector isn't doing that.

Connecting to SnowSQL Client using Snowflake Credentials

I have successfully installed SnowSQL Client version 1.2.5 and while trying to get log into my snowflake account, using account id, username and password, I am somehow unable to connect and get following error:
snowsql unable to log in
This appears to be networking issue. Have you tried to set that debug logging as directed?
To assist in situations like this, Snowflake has a tool which could help you determine if your client host is able to access all required network endpoints for your Snowflake account, it's called SnowCD, the documents are here and the installation is fairly straightforward:
https://docs.snowflake.com/en/user-guide/snowcd.html
I'd recommend trying SnowCD as your first step, the next step would be to review any required proxy settings your organization might have. I'd also double-check your "account name" argument, the URL looks OK to me but there is a nice writeup on the account name construction at this link:
https://docs.snowflake.com/en/user-guide/connecting.html#your-snowflake-account-name
I hope this helps...Rich
THANKS Rich for doing some R&D and sharing proposals. I got successfully logged into snowsql by providing my account id till ".aws". Hope it will help others struggling so far, like myself:
https://docs.snowflake.com/en/user-guide/getting-started-tutorial-log-in.html
demo log in

Get AzureAD devices non-interactively - using API

I need to retrieve all devices in an AzureAD from a background-application which needs to run without user interaction.
My research so far has come up empty, with Graph API as the only option to get the actual data - but doesn't support non-interactive scenarios. :(
Question
Is there a way/API to get all devices in a non-interavtive way?
Research
Graph API:
https://learn.microsoft.com/en-gb/graph/api/intune-devices-manageddevice-get?view=graph-rest-1.0
Does not support non-interactive screnarios, as confirmed in above screenshot from the documentation and the below links:
https://microsoftintune.uservoice.com/forums/291681-ideas/suggestions/18474520-intune-graph-api-should-be-accessible-non-interact
https://social.technet.microsoft.com/Forums/en-US/1636481c-7101-43d4-9f60-e09cdd65b4b0/noninteractive-access-to-intune-api?forum=microsoftintuneprod
MS Graph API - ManagedDevices obtaining Scope
Azure AD Graph API
https://msdn.microsoft.com/Library/Azure/Ad/Graph/api/api-catalog
Not recommended by MS - and doesn't seem to have a way to get devices either.
You can use the following "GET https://graph.microsoft.com/v1.0/devices". This call retrieves the list of device objects registered in the organization.
This call is supported in non-interactive scenarios as well. The application will need one of the following permissions.
Application :
Device.Read.All, Directory.Read.All
You can also check all the operations available in MS Graph for a device object here.

Connecting to an LDAP server via a Corporate Proxy

I'm using the OpenLDAP API in C to connect to an external LDAP server and retrieve certain information. However, the software needs to run behind a HTTP CONNECT corporate proxy.
OpenLDAP doesn't expose the underlying socket calls, so is there a way to use the OpenLDAP API to specify a proxy to go through?
LDAP* lp;
int res = ldap_initialize(&lp, "ldap://some-server.com:389");
... /* Can I specify a proxy server somehow here? */
ldap_sasl_bind_s(m_connection, "", LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL);
I looked through the manual and did some Googling and found LDAP_OPT_URI which is an option code that can be passed to ldap_set_option, along with a URI. The manual describes the purpose of this option as :
"Sets/gets a comma- or space-separated list of URIs to be contacted by
the library when trying to establish a connection."
That description seems a bit vague to me, but I thought it might sound like this could allow me to set a proxy URL. However, I tried it and it has no effect anyway.
So, does OpenLDAP provide some way to connect via a proxy?

solr4.0, wrong hostname when there is a dot

I am building a full distributed solr cluster on different servers, the servers are server1.mycompany.com and server2.mycompany.com. after configuration when I click server1.mycompany.com in web console, solr try to connect server1:8983/solr rather than server1.mycompany.com:8983/solr. And I use java API:
ZkStateReader zkStateReader = cloudQuery.getCloudSolrServer().getZkStateReader();
ClusterState clusterState = zkStateReader.getClusterState();
System.out.println(clusterState);
I still get "node_name":"server1:8983_solr","base_url":"http://server1:8983/solr".
anyone give a hint? is this a bug or something to be configured?

Resources