github.com/minio/minio@v0.0.0-20240328213742-3f72439b8a27/docs/sts/dex.md (about)

     1  # Dex Quickstart Guide [![Slack](https://slack.min.io/slack?type=svg)](https://slack.min.io)
     2  
     3  Dex is an identity service that uses OpenID Connect to drive authentication for apps. Dex acts as a portal to other identity providers through "connectors." This lets dex defer authentication to LDAP servers, SAML providers, or established identity providers like GitHub, Google, and Active Directory. Clients write their authentication logic once to talk to dex, then dex handles the protocols for a given backend.
     4  
     5  ## Prerequisites
     6  
     7  Install Dex by following [Dex Getting Started Guide](https://dexidp.io/docs/getting-started/)
     8  
     9  ### Start Dex
    10  
    11  ```
    12  ~ ./bin/dex serve dex.yaml
    13  time="2020-07-12T20:45:50Z" level=info msg="config issuer: http://127.0.0.1:5556/dex"
    14  time="2020-07-12T20:45:50Z" level=info msg="config storage: sqlite3"
    15  time="2020-07-12T20:45:50Z" level=info msg="config static client: Example App"
    16  time="2020-07-12T20:45:50Z" level=info msg="config connector: mock"
    17  time="2020-07-12T20:45:50Z" level=info msg="config connector: local passwords enabled"
    18  time="2020-07-12T20:45:50Z" level=info msg="config response types accepted: [code token id_token]"
    19  time="2020-07-12T20:45:50Z" level=info msg="config using password grant connector: local"
    20  time="2020-07-12T20:45:50Z" level=info msg="config signing keys expire after: 3h0m0s"
    21  time="2020-07-12T20:45:50Z" level=info msg="config id tokens valid for: 3h0m0s"
    22  time="2020-07-12T20:45:50Z" level=info msg="listening (http) on 0.0.0.0:5556"
    23  ```
    24  
    25  ### Configure MinIO server with Dex
    26  
    27  ```
    28  ~ export MINIO_IDENTITY_OPENID_CLAIM_NAME=name
    29  ~ export MINIO_IDENTITY_OPENID_CONFIG_URL=http://127.0.0.1:5556/dex/.well-known/openid-configuration
    30  ~ minio server ~/test
    31  ```
    32  
    33  ### Run the `web-identity.go`
    34  
    35  ```
    36  ~ go run web-identity.go -cid example-app -csec ZXhhbXBsZS1hcHAtc2VjcmV0 \
    37       -config-ep http://127.0.0.1:5556/dex/.well-known/openid-configuration \
    38       -cscopes groups,openid,email,profile
    39  ```
    40  
    41  ```
    42  ~ mc admin policy create admin allaccess.json
    43  ```
    44  
    45  Contents of `allaccess.json`
    46  
    47  ```json
    48  {
    49    "Version": "2012-10-17",
    50    "Statement": [
    51      {
    52        "Effect": "Allow",
    53        "Action": [
    54          "s3:*"
    55        ],
    56        "Resource": [
    57          "arn:aws:s3:::*"
    58        ]
    59      }
    60    ]
    61  }
    62  ```
    63  
    64  ### Visit <http://localhost:8080>
    65  
    66  You will be redirected to dex login screen - click "Login with email", enter username password
    67  > username: admin@example.com
    68  > password: password
    69  
    70  and then click "Grant access"
    71  
    72  On the browser now you shall see the list of buckets output, along with your temporary credentials obtained from MinIO.
    73  
    74  ```
    75  {
    76   "buckets": [
    77    "dl.minio.equipment",
    78    "dl.minio.service-fulfillment",
    79    "testbucket"
    80   ],
    81   "credentials": {
    82    "AccessKeyID": "Q31CVS1PSCJ4OTK2YVEM",
    83    "SecretAccessKey": "rmDEOKARqKYmEyjWGhmhLpzcncyu7Jf8aZ9bjDic",
    84    "SessionToken": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiJRMzFDVlMxUFNDSjRPVEsyWVZFTSIsImF0X2hhc2giOiI4amItZFE2OXRtZEVueUZaMUttNWhnIiwiYXVkIjoiZXhhbXBsZS1hcHAiLCJlbWFpbCI6ImFkbWluQGV4YW1wbGUuY29tIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsImV4cCI6IjE1OTQ2MDAxODIiLCJpYXQiOjE1OTQ1ODkzODQsImlzcyI6Imh0dHA6Ly8xMjcuMC4wLjE6NTU1Ni9kZXgiLCJuYW1lIjoiYWRtaW4iLCJzdWIiOiJDaVF3T0dFNE5qZzBZaTFrWWpnNExUUmlOek10T1RCaE9TMHpZMlF4TmpZeFpqVTBOallTQld4dlkyRnMifQ.nrbzIJz99Om7TvJ04jnSTmhvlM7aR9hMM1Aqjp2ONJ1UKYCvegBLrTu6cYR968_OpmnAGJ8vkd7sIjUjtR4zbw",
    85    "SignerType": 1
    86   }
    87  }
    88  ```
    89  
    90  Now you have successfully configured Dex IdP with MinIO.
    91  
    92  > NOTE: Dex supports groups with external connectors so you can use `groups` as policy claim instead of `name`.
    93  
    94  ```
    95  export MINIO_IDENTITY_OPENID_CLAIM_NAME=groups
    96  ```
    97  
    98  and add relevant policies on MinIO using `mc admin policy create myminio/ <group_name> group-access.json`
    99  
   100  ## Explore Further
   101  
   102  - [MinIO STS Quickstart Guide](https://min.io/docs/minio/linux/developers/security-token-service.html)
   103  - [The MinIO documentation website](https://min.io/docs/minio/linux/index.html)