Use openstacksdk created user, can not login - openstacksdk

My openstack version is ocata.
In my computer I installed the openstacksdk (0.9.18), when I use it to create a openstack user like bellow:
# create openstack user
user_args = {
"default_project_id":new_project.id, # the project is created already, there I did not post here.
"email":email,
"is_enabled":True,
"name":username,
"pasword":password,
}
try:
new_user = super_conn.conn.identity.create_user(**user_args)
except Exception as e:
raise e
try:
role_user = super_conn.conn.identity.find_role(OPENSTACK_ROLE_USER) # there I find the role(user)
new_project.assign_role_to_user(super_conn.conn.session, new_user, role_user) # assign to the new user
new_project.validate_user_has_role(super_conn.conn.session, new_user, role_user)
except Exception as e:
raise e
I have debug the username and password in my code, my code is no mistake.
I created the new_user, and I also in openstack dashboard, checked the user and the user's project.
But I can not use the username and password to login the openstack dashboard.
Whether there is something wrong with it?
the error means the credentials invalid. So, I use openstack admin user to change the created user's password, then I can login yet.

You didn't mention anything about roles for the user. Maybe the problem is lack of a role of any sort.

Related

Grafana :: Cannot login to http://localhost:3000/login

I freshly installed Grafana and I cannot login at http://localhost:3000/login
All documentation shows that the default user/password should be admin/admin but I'm locked out.
If I go to check into the file C:\Program Files\GrafanaLabs\grafana\defaults.ini the values are set to:
[security]
# disable creation of admin user on first start of grafana
disable_initial_admin_creation = false
# default admin user, created on startup
admin_user = admin
# default admin password, can be changed before first start of grafana, or in profile settings
admin_password = admin
# used for signing
secret_key = SW2YcwTIb9zpOOhoPsMm
# current key provider used for envelope encryption, default to static value specified by secret_key
encryption_provider = secretKey
If I try to retrieve the password through the e-mail I receive no e-mail.
What am I doing wrong?
The problem come from the grafana.db file. This is where your password is stored.
In your local machine, install the sqlite3 package
sudo apt-get install sqlite3
Login into your sql database
sudo sqlite3 /var/lib/grafana/grafana.db
Reset the admin password using SQL update (the new password will be admin)
sqlite> update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6', salt = 'F3FAxVm33R' where login = 'admin';
sqlite> .exit
Now, you could log in your Grafana web interface using username: admin and password: admin
Why is the login with admin:admin despite the configuration not working?
One possibility here is that you had Grafana installed previously (and when using it with the admin account already had to change the default password set in the config). In that case, you did not freshly install Grafana but instead upgraded it. That preserves the database including users and passwords, therefore you will have to use the password you set for that account.
Why are you not getting a reset password email?
I can think of two possibilities here: One is that Email is not configured in the Grafana config file and therefore no emails can be sent. The second one is that you did not set the email address for the account in question (afaik defaults to "admin#localhost") and therefore you don't get any emails. Of course it is possible that both is the case.
How can you solve this?
By either resetting the admin password (that will allow you to keep your existing data) or by removing Grafana and all files completely and making a fresh install.

Map for SSPI - fatal: role does not exist - case issue

I use pg_ident.conf (PostgreSQL 12, OS Windows Server 2019) file to map users for SSPI this way:
# MAPNAME SYSTEM-USERNAME PG-USERNAME
MapForSSPI someone#COMPANY someone
Recently I had to add new user, which I did exactly the same way as usual. I have created role "newsomeone" via pgAdmin, added membership properly, and added user into pg_ident.conf as:
MapForSSPI newsomeone#COMPANY newsomeone
But when this user tried to connect:
FATAL: role "NewSomeone" does not exist
Please be aware of CASE. With further testing I realized the OS login is really set up as NewSomeone#COMPANY, but what I really do not understand is why is this login with capital letters not mapped to my lowercase login "newsomeone". When I've created new role "NewSomeone" via pgAdmin without any change to pg_ident.conf, the connection is successful.
How is it possible that with PG-USERNAME "newsomeone" specified in lowercase in pg_ident.conf it looks for role "NewSomeone" (as in OS login)?
pg_ident.conf is there to allow the system-authenticated user to login as a specific requested database user, when the spelling of the two doesn't match. It is not there to rewrite the requested database user into a different database user.
As long as your client is demanding to login as database user "NewSomeone", either it will succeed as that user, or it will fail as that user. It will not pick a different name to log in as.
You need to fix your client connection code (which you didn't show) so that it attempts to log in with the correct spelling.

Your token has not been granted the required scopes to execute this query. The 'id' field requires one of the following scopes: ['read:packages'],

I am using Windows 10 Pro and trying to publish a docker image to GitHub by using PowerShell tag and push commands.
docker tag 8a3e8abca3b6 docker.pkg.github.com/liufa/testdockerandk8/dockerandk8test:0.1
docker push docker.pkg.github.com/liufa/testdockerandk8/dockerandk8test:0.1
However, I am getting the following error
unauthorized: Your token has not been granted the required scopes to execute this query. The 'id' field requires one of the following scopes: ['read:packages'], but your token has only been granted the: [''] scopes.
Where do I change token permissions?
docker login -u USERNAME -p TOKEN docker.pkg.github.com
docker push docker.pkg.github.com/liufa/testdockerandk8/dockerandk8test:0.1
Here, replace USERNAME with your username and TOKEN with the personal access token generated with read/write/delete:packages enabled
https://github.com/settings/tokens
Found it myself.
Go to your GitHub account -> Settings -> Developer Settings
Click new token
Then add the permissions that are required.
Then don't forget to scroll down and click Save
Then go back to PowerShell and login again, but use the new token as password
Run the push command again (docker push docker.pkg.github.com/liufa/testdockerandk8/dockerandk8test:0.1)
Hope this saves you some time.

Forgot mongodb admin database credentials. Reset everything

I forgot the credentials of my admin user.
Hence i am not able to connect to cluster mongo shell.
Now i want to delete all users and and credentials or even if reset of mongodb is possible then it will be a lot help.
I tried following commands but got "authentication required error".
db.createUser(), db.dropDatabase().
I expect to create new admin user with credentials.
you can do it by logging in to your Atlas Cluster here: https://www.mongodb.com. Then, on the left sidebar, you click on 'Database Access'. There you can manage the users and you can even delete them and create new ones.

CKAN systemadmin user and password

I installed for the first time on my OS X CKAN (And is possible ive made some mistake). Now i want to play with the UI backend but when I go in "login" section it ask me for User/password
I'm using my postgres user and user's password for access it but it give me error.
If I list the db I can see my user there but when I login it say "user doesn't exist"
So which one is the CKAN Systemadmin access?
Reading in the docs it just say, you shoudl have create this user during installation process
you can run this paster command to create a sysadmin user:
paster --plugin=ckan sysadmin add <username> --config=/etc/ckan/development.ini
For more, see http://docs.ckan.org/en/latest/maintaining/paster.html