question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Canned policy not applied when using AssumeRoleWithClientGrants and JS SDK

See original GitHub issue

Expected Behavior

When using the JS SDK to sign in a client with temp. credentials - token and policy provided by keycloak- the policy should be applied no matter if it is a default or a custom one.

Current Behavior

When using default policy e.g. readwrite everything is ok (I can list the buckets) but when I set the policy to restricted (a custom policy I created) I have a S3Error: Access Denied. message. Notice that the custom policy is correctly applied when using the OpenID button on the Minio browser.

Possible Solution

Steps to Reproduce (for bugs)

  1. Create a user with a custom policy in Keycloak
  2. Get the Token from Keycloak for the user
  3. Use the AssumeRoleWithClientGrants to get temp credentials
  4. Use the JS SDK the list the buckets => S3Error: Access Denied.

Context

Regression

Your Environment

  • Version used (minio version): docker minio/minio:edge
  • Environment name and version (e.g. nginx 1.9.1):
  • Server type and version:
  • Operating System and version (uname -a): windows
  • Link to your project:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
harshavardhanacommented, Jan 16, 2020

My problem is not to retrieve AccessKeyID / SecretAccessKey / SessionToken but to Initialize a Minio client (with those key/secret/token) with the correct policy applied.

So what you mean from your previous reply ( #818 (comment) ) is by using the Go client API https://docs.min.io/docs/golang-client-api-reference I shouldn’t got the issue. Am I right ?

in minio-js that’s not allowed in minio-go it is allowed using the credential.Credentials structure look at the method minio.NewWithCredentials

0reactions
prakashsvmxcommented, Sep 7, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Canned Policy vs Custom Policy Archives
Here is all you need to know about Canned Policy vs Custom Policy . ... The website can be used with the CloudFront...
Read more >
Implement AssumeRole API for Minio users (#7267)
GetUserPolicy - returns canned policy name associated with a user. func (sys *IAMSys) GetUserPolicy(accessKey string) (policyName string, err error) {.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found