keycloak external command line client examples - keycloak

Are there any good examples out there to authenticate a command line client with keycloak?
When I search for "keycloak command line client examples" I am getting results that show how to use the existing admin command line client.
I want to create a command line client for my users to authenticate with my app.

Related

When I log in to the Cloud foundry (Authenticating... {"error":"invalid_grant","error_description":"User authentication failed: unauthorized"})

I am inside the SAP Business Application Studio, inside the terminal, when I put the CF login command I enter my credentials and this appears
Authenticating...
{"error":"invalid_grant","error_description":"User authentication failed: Unauthorized"}
Could you please help me
The solution on my side is to use the --sso option.
cf login --sso -a https://api.cf.us10.hana.ondemand.com
Afterwards you will be prompted to get a passcode from this url: https://login.cf.us10.hana.ondemand.com/passcode
However, for me this failed several times.
The key is to use alternative identity provider on the login screen
and enter sap.ids as provider when you already have an SAP Universal login
Sadly, this does not work when using trial version in API endpoint https://api.cf.us10-001.hana.ondemand.com . I already opened a support request.

How to (set permissions to) access a Google Storage bucket from a command line program?

In my particular case, I would like to open an object with Tensorboard (A Tensorflow component). The command line instruction is the following:
# tensorboard --logdir=gs://mybucket/myobject
gs://mybucket/myobject is not a public object. So the line above generates a forbidden access error. The closest thing I found is gsutil signurl but it generates an http download link. What I think I need is an authenticated gs://... link, how can I create it?
I believe that Tensorboard uses Application Default Credentials for auth. If you have the gcloud command installed, try running gcloud auth application-default login before running tensorboard, and I believe that it should use your credentials to fetch the GCS object.

How do I manage org and space users in bluemix using cf command line?

Bluemix provides a CF command line for download to manage applications.
We want to use CF (or any other command line tools ) to manage Organization and Space users. This will allow us to programmatically sync the user list.
Specifically I am looking for
cf enroll-user
cf add-user
cf remove-user
cf unenroll-use
the cf command already lists the users for a given ORG and SPACE.
The simple answer is to read the docs. See "Creating and Managing Users with the cf CLI." It documents commands like create-user, set-org-role, and set-space-role.
For example: Use cf create-user USERNAME PASSWORD to create a new user. The problem is, when you try to do this in Bluemix, you get an error:
>cf create-user jdoe password
Creating user jdoe as bwoolf...
FAILED
Error creating user jdoe.
Server error, status code: 403, error code: access_denied, message: Invalid token does not contain resource id (scim)
You get a similar error when you try to run set-org-role or set-space-role:
FAILED
Server error, status code: 403: Access is denied. You do not have privileges to execute this command.
Why did you get this error? Like #RandalAnders explained, Bluemix currently blocks users from using these user administration commands in the CF CLI. For the time being, you'll need to perform these actions using the Bluemix Dashboard.
Currently, it is not possible within Bluemix to use the CF CLI for certain management commands, as they require administrative privileges. We are exploring expanding the scope of the commands used in the CLI and would be interested in hearing any other use cases you may have.
you can not create a user on bluemix using cf cli since it needs admin privileges. To add a user, you will need to use bluemix cli 'bluemix iam account-user-invite' to invite a user to your account with a org/space role assigned. There are other account/org/space/role management commands under 'bluemix iam'.
Download bluemix CLI here: http://clis.ng.bluemix.net

Moodle LDAP authentication

I'm using moodle 2.7 ,i need to use LDAP authentication for allowing users to login using external LDAP server(with their username and password).i have tried with the apache directory studio.But i got "Invalid login" error.But the login details were correct.
Please suggest me with some other LDAP server and how to add user details in that server and do authentication in moodle.
FusionDirectory is a reasonable alternative. It's based on OpenLDAP and it's pretty well documented.
Assuming that you're in a Linux environment, you can install it relatively easily/quickly via SSH. Once the download is complete, follow the on-screen instructions which is not that wildly different from setting up any odd CMS/LMS. The default URL is yourdomain.url/fusiondirectory.
When that's all done and dusted, you'll be taken back to the login page where you can sign in for the first time using the credentials you created during the set up process.
You can use your dashboard to add users/groups.
Once you've got a few users in there, it's now time to jump back to Moodle. Hop over to Site Admin -> Plugins -> Authentication -> Manage Authentication and enable "LDAP Server" then open up its settings. Fill in the details of your LDAP server such that it matches the details of the FusionDirectory.
This will set up the connection, but you will finally need to set up a cron job to regularly sync your databases together. Jump to SSH or cPanel->Cron jobs (Whatever option you prefer) and run the following crontab:
wget -q -O /dev/null https://yourdomain.url/auth/ldap/cli/sync_users.php
It's up to you how frequently you choose to set it.
HTH.

Access Denied while connecting to External Rest API from SharePoint Designer page

While trying to connect external Restful API from my SharePoint designer page (On Premises) I am getting access denied error may be its because its cross domain but now I am getting No "Transport error".Last time I had the same situation to i ran some power shell command(3 Line) which i got from website in which they enable cross site scripting for web application if possible can someone send me that script again like below.
spwebapp = get-spwebapplication
spwebapp = enable/allow.crosssite
spwebapp.update
I think that power shell command modify the file
xmlhttprequest