Skip to content
Snippets Groups Projects
Commit da52e64c authored by Martin Weise's avatar Martin Weise
Browse files

Merge branch '395-support-basic-authentication-2' into 'dev'

Resolve "Support basic authentication"

See merge request !241
parents e0b64e86 c5bf8134
No related branches found
No related tags found
5 merge requests!250Master,!246Dev,!244Dev,!243Dev,!241Resolve "Support basic authentication"
Showing
with 737 additions and 603 deletions
......@@ -14,9 +14,9 @@ externalDocs:
url: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services
servers:
- url: http://localhost:9093
description: Generated server url
description: Development instance
- url: https://test.dbrepo.tuwien.ac.at
description: Sandbox
description: Staging instance
paths: {}
components:
securitySchemes:
......
This diff is collapsed.
html,
body {
background: #eee;
}
.scheme-container {
background: none !important;
box-shadow: none !important;
padding: 0 !important;
}
\ No newline at end of file
File deleted
......@@ -8,8 +8,8 @@ services[9099]=metadata
services[3305]=sidecar
# clean up
echo "clean up ./dist ./site"
rm -rf ./dist ./site
echo "clean up ./site"
rm -rf ./site
# ensure target directories are present
echo "ensure target directory ./site are present"
......@@ -17,11 +17,11 @@ mkdir -p ./site
# extract static site
echo "extract static site .docs/.swagger/dist.tar.gz"
tar xzf .docs/.swagger/dist.tar.gz
for key in "${!services[@]}"; do
mkdir -p ./site/${services[$key]}
echo "extract static site ./dist -> ./site/${services[$key]}"
cp -r ./dist/* ./site/${services[$key]}
echo "placing .docs/.swagger/api-${services[$key]}.yaml -> ./site/${services[$key]}/api.yaml"
echo "extract static site ./swagger-ui.html -> ./site/${services[$key]}"
cp .docs/.swagger/swagger-ui.html ./site/${services[$key]}/index.html
cp .docs/.swagger/custom.css ./site/${services[$key]}/custom.css
sed -i -e "s/__SERVICENAME__/${services[$key]^} Service/g" ./site/${services[$key]}/index.html
cp ".docs/.swagger/api-${services[$key]}.yaml" "./site/${services[$key]}/api.yaml"
done
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="description" content="__SERVICENAME__ API description in OpenAPI 3.0"/>
<title>__SERVICENAME__ API</title>
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5.11.1/swagger-ui.css"/>
<link rel="stylesheet" href="./custom.css"/>
<link rel="icon" href="https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/.docs/images/signet_white.png" />
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist@5.11.1/swagger-ui-bundle.js" crossorigin></script>
<script src="https://unpkg.com/swagger-ui-dist@5.11.1/swagger-ui-standalone-preset.js" crossorigin></script>
<script>
window.onload = () => {
window.ui = SwaggerUIBundle({
url: 'api.yaml',
dom_id: '#swagger-ui',
});
};
</script>
</body>
</html>
\ No newline at end of file
......@@ -29,7 +29,7 @@ about values, etc.
## Limitations
1. MariaDB Galera does not (yet) support XA-transactions required by the authentication service (=Keycloak). Therefore
only a single MariaDB pod can be deployed at once for the [auth database](../system-databases-auth).
only a single MariaDB pod can be deployed at once for the [auth database](../system-databases-authentication).
!!! question "Do you miss functionality? Do these limitations affect you?"
......
<mxfile host="Electron" modified="2024-01-18T09:36:17.787Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.1.18 Chrome/120.0.6099.199 Electron/28.1.2 Safari/537.36" etag="VyIG_SLmjDzwPbzvCqrk" version="22.1.18" type="device" pages="7">
<mxfile host="Electron" modified="2024-01-27T20:29:22.079Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/23.0.2 Chrome/120.0.6099.109 Electron/28.1.0 Safari/537.36" etag="yip1JA4z9fltPW3TVpkZ" version="23.0.2" type="device" pages="7">
<diagram id="mvBsv1rP8O80Qe3yGnn_" name="docker-compose">
<mxGraphModel dx="1434" dy="822" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root>
......@@ -581,8 +581,8 @@
</root>
</mxGraphModel>
</diagram>
<diagram id="e2fuorb2m_XjboQ7R7_y" name="Data Ingest">
<mxGraphModel dx="1147" dy="658" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<diagram id="e2fuorb2m_XjboQ7R7_y" name="data-ingest">
<mxGraphModel dx="1195" dy="685" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
......@@ -600,21 +600,6 @@
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="0VJCIkSjTVNNat6pGbHc-35" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.75;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0;entryDx=0;entryDy=27.5;entryPerimeter=0;" parent="1" source="0VJCIkSjTVNNat6pGbHc-3" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="480" y="340" />
<mxPoint x="530" y="340" />
<mxPoint x="530" y="428" />
</Array>
<mxPoint x="575" y="427.5" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="0VJCIkSjTVNNat6pGbHc-36" value="3306/tcp" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="0VJCIkSjTVNNat6pGbHc-35" vertex="1" connectable="0">
<mxGeometry x="0.2112" y="-1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="0VJCIkSjTVNNat6pGbHc-41" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.25;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="0VJCIkSjTVNNat6pGbHc-3" target="0VJCIkSjTVNNat6pGbHc-33" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="395" y="318" as="sourcePoint" />
......@@ -648,8 +633,8 @@
<mxCell id="0VJCIkSjTVNNat6pGbHc-7" value="&lt;b&gt;JDBC&lt;/b&gt;" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" parent="1" vertex="1">
<mxGeometry x="584" y="170" width="30" height="60" as="geometry" />
</mxCell>
<mxCell id="0VJCIkSjTVNNat6pGbHc-8" value="3306/tcp" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#000000;startArrow=classic;startFill=1;dashed=1;" parent="1" edge="1">
<mxGeometry x="-0.314" relative="1" as="geometry">
<mxCell id="0VJCIkSjTVNNat6pGbHc-8" value="3307/tcp" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#000000;startArrow=classic;startFill=1;dashed=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" edge="1" source="yvNGLmbJRMNvVS071MuP-1">
<mxGeometry x="-0.0158" relative="1" as="geometry">
<mxPoint x="513" y="300" as="sourcePoint" />
<mxPoint as="offset" />
<mxPoint x="600" y="250" as="targetPoint" />
......@@ -675,7 +660,7 @@
</mxCell>
<mxCell id="0VJCIkSjTVNNat6pGbHc-38" value="3306/tcp" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="0VJCIkSjTVNNat6pGbHc-37" vertex="1" connectable="0">
<mxGeometry x="-0.1716" y="1" relative="1" as="geometry">
<mxPoint as="offset" />
<mxPoint x="3" y="-8" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="0VJCIkSjTVNNat6pGbHc-26" value="Data Service&lt;br&gt;(Spring AMQP)" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
......@@ -687,18 +672,13 @@
<mxCell id="0VJCIkSjTVNNat6pGbHc-29" value="Broker Service&lt;br style=&quot;border-color: var(--border-color);&quot;&gt;(RabbitMQ)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E6E6E6;" parent="1" vertex="1">
<mxGeometry x="399.5" y="360" width="96" height="40" as="geometry" />
</mxCell>
<mxCell id="0VJCIkSjTVNNat6pGbHc-39" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0;entryDx=0;entryDy=52.5;entryPerimeter=0;" parent="1" source="0VJCIkSjTVNNat6pGbHc-33" edge="1">
<mxCell id="0VJCIkSjTVNNat6pGbHc-39" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="0VJCIkSjTVNNat6pGbHc-33" edge="1" target="yvNGLmbJRMNvVS071MuP-1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="530" y="500" />
<mxPoint x="530" y="453" />
<mxPoint x="530" y="440" />
</Array>
<mxPoint x="575" y="452.5" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="0VJCIkSjTVNNat6pGbHc-40" value="3306/tcp" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="0VJCIkSjTVNNat6pGbHc-39" vertex="1" connectable="0">
<mxGeometry x="-0.0808" y="-1" relative="1" as="geometry">
<mxPoint x="-29" y="-1" as="offset" />
<mxPoint x="570" y="440" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="0VJCIkSjTVNNat6pGbHc-33" value="Metadata Service&lt;br&gt;(Spring AMQP)" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
......@@ -710,25 +690,25 @@
<mxCell id="JkB3rZmVi6YrdEwAjtGV-5" value="Storage Service&lt;br&gt;(SeaweedFS)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E6E6E6;" parent="1" vertex="1">
<mxGeometry x="237" y="394" width="96" height="40" as="geometry" />
</mxCell>
<mxCell id="yvNGLmbJRMNvVS071MuP-1" value="" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=8.600000000000023;fillColor=#dae8fc;strokeColor=#000000;" vertex="1" parent="1">
<mxCell id="yvNGLmbJRMNvVS071MuP-1" value="" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=8.600000000000023;fillColor=#dae8fc;strokeColor=#000000;" parent="1" vertex="1">
<mxGeometry x="575" y="408" width="50" height="64" as="geometry" />
</mxCell>
<mxCell id="yvNGLmbJRMNvVS071MuP-2" value="data-db" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;spacing=-1;" vertex="1" parent="1">
<mxCell id="yvNGLmbJRMNvVS071MuP-2" value="data-db" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;spacing=-1;" parent="1" vertex="1">
<mxGeometry x="559" y="470" width="85" height="20" as="geometry" />
</mxCell>
<mxCell id="jJosZR_OhRTGx9p3jnjP-1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#E6E6E6;" vertex="1" parent="1">
<mxCell id="jJosZR_OhRTGx9p3jnjP-1" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#E6E6E6;" parent="1" vertex="1">
<mxGeometry x="447.5" y="540" width="30" height="16" as="geometry" />
</mxCell>
<mxCell id="jJosZR_OhRTGx9p3jnjP-2" value="External images" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxCell id="jJosZR_OhRTGx9p3jnjP-2" value="External images" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="485" y="540" width="140" height="16" as="geometry" />
</mxCell>
<mxCell id="jJosZR_OhRTGx9p3jnjP-3" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="jJosZR_OhRTGx9p3jnjP-3" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="447.5" y="560" width="30" height="16" as="geometry" />
</mxCell>
<mxCell id="jJosZR_OhRTGx9p3jnjP-4" value="Maintained images" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxCell id="jJosZR_OhRTGx9p3jnjP-4" value="Maintained images" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="485" y="560" width="140" height="16" as="geometry" />
</mxCell>
<mxCell id="jJosZR_OhRTGx9p3jnjP-5" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#000000;" vertex="1" parent="1">
<mxCell id="jJosZR_OhRTGx9p3jnjP-5" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#000000;" parent="1" vertex="1">
<mxGeometry x="462.5" y="540" width="15" height="16" as="geometry" />
</mxCell>
</root>
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -9,14 +9,14 @@ figure img.img-border {
border: 1px solid #b3b3b3;
}
.md-main .md-content a:not(.action-button),
.md-main .md-content a:not(.action-button) {
.md-main .md-content a:not(.action-button):not([tabindex]),
.md-main .md-content a:not(.action-button):not([tabindex]) {
color: var(--md-typeset-color);
border-bottom: 2px solid var(--md-primary-fg-color);
}
.md-main .md-content a:not(.action-button):focus,
.md-main .md-content a:not(.action-button):hover {
.md-main .md-content a:not(.action-button):not([tabindex]):focus,
.md-main .md-content a:not(.action-button):not([tabindex]):hover {
color: var(--md-typeset-color);
border-bottom: 2px solid var(--md-primary-fg-color--dark);
}
......
......@@ -2,7 +2,7 @@
author: Martin Weise
---
# Auth Database
# Authentication Database
## tl;dr
......
......@@ -25,7 +25,9 @@ author: Martin Weise
By default, only one Data Database is deployed. You can deploy multiple (different) Data Database instances and make
them available in the repository as follows:
```console
=== "Terminal"
```shell
curl \
-sSL \
http://<hostname>/api/container \
......@@ -71,7 +73,9 @@ natively.
Export all databases with `--skip-lock-tables` option for MariaDB Galera clusters as it is not supported currently by
MariaDB Galera.
```console
=== "Terminal"
```shell
mariadb \
-u <privilegedUsername> \
-p<privilegedPassword> \
......@@ -83,7 +87,9 @@ mariadb \
### Restore
```console
=== "Terminal"
```shell
mariadb \
-u <privilegedUsername> \
-p<privilegedPassword> < dump.sql
......
......@@ -27,6 +27,12 @@ the [Search Database](../system-databases-search).
(none)
!!! question "Do you miss functionality? Do these limitations affect you?"
We strongly encourage you to help us implement it as we are welcoming contributors to open-source software and get
in [contact](../contact) with us, we happily answer requests for collaboration with attached CV and your programming
experience!
## Security
(none)
......@@ -116,6 +116,12 @@ The response looks like this:
(none)
!!! question "Do you miss functionality? Do these limitations affect you?"
We strongly encourage you to help us implement it as we are welcoming contributors to open-source software and get
in [contact](../contact) with us, we happily answer requests for collaboration with attached CV and your programming
experience!
## Security
(none)
......@@ -11,19 +11,13 @@ author: Martin Weise
Image: [`dbrepo/authentication-service:__APPVERSION__`](https://hub.docker.com/r/dbrepo/authentication-service)
* Ports: 8080/tcp
* Health: `http://<hostname>:8080/api/auth/health`
* Prometheus: `http://<hostname>:8080/api/auth/metrics`
* UI: `http://<hostname>/api/auth/admin/`
## Overview
From version 1.2 onwards we use Keycloak for authentication for managing a part of the user identity and deprecated the
Spring Boot application instead. Going forward, the authentication will be
through [Keycloak by RedHat](https://quay.io/repository/keycloak/keycloak?tab=info).
By default, users are created using the [UI](../system-other-ui) and the sign-up page in the UI. A new user is also
created in the UI creates a new user in the [Auth Database](../system-databases-auth), consequently a part of the
user identity is managed by Keycloak.
By default, users are created using the [User Interface](../system-other-ui) and the sign-up page in the User Interface.
This creates a new user in the [Authentication Database](../system-databases-authentication), the user identity is then managed by the
Authentication Service.
## Groups
......@@ -203,6 +197,7 @@ public ResponseEntity<DatabaseBriefDto> create(@NotNull Long containerId,
* No support for sending e-mails through Keycloak by default.
* No support for temporary passwords.
* No support for adding identifies in Keycloak directly.
* No support for multi-factor authentication.
!!! question "Do you miss functionality? Do these limitations affect you?"
......
......@@ -60,6 +60,13 @@ services:
(none relevant to DBRepo)
!!! question "Do you miss functionality? Do these limitations affect you?"
We strongly encourage you to help us implement it as we are welcoming contributors to open-source software and get
in [contact](../contact) with us, we happily answer requests for collaboration with attached CV and your programming
experience!
## Security
1. Enable TLS encryption by downloading
......
......@@ -29,7 +29,7 @@ that holds all the metadata information which is mirrored from the [Metadata Dat
<figure markdown>
![Mirroring statistical properties in Metadata Database and Search Database](images/statistics-mirror.png)
<figcaption>Statistical properties in Metadata Database and Search Database</figcaption>
<figcaption>Figure 1: Statistical properties in Metadata Database and Search Database</figcaption>
</figure>
## Faceted Browsing
......@@ -54,7 +54,7 @@ the units of measurements can be transformed.
<figure markdown>
![Two tables with compatible semantic concepts (Temperature) and units of measurement (left is in degree Celsius, right is in degree Fahrenheit)](images/statistics-example.png)
<figcaption>Two tables with compatible semantic concepts and units of measurement</figcaption>
<figcaption>Figure 2: Two tables with compatible semantic concepts and units of measurement</figcaption>
</figure>
In short, the search service transforms the statistical properties not in the target unit of measurements is transformed
......@@ -66,12 +66,12 @@ between 32 - 50 &deg;F"* instead.
<figure markdown>
![Unit independent search query transformation](images/statistics-example-unit-independent-search.png)
<figcaption>Unit independent search query transformation</figcaption>
<figcaption>Figure 3: Unit independent search query transformation</figcaption>
</figure>
## Examples
TBD
View [usage examples](../usage-search/).
## Limitations
......
......@@ -6,14 +6,22 @@ author: Martin Weise
!!! abstract "Abstract"
This is the full system description from a technical/developer view.
This is the full system description from a technical/developer view and continously being updated as the development
progresses.
We invite all open-source developers to help us fixing bugs and introducing features to the source code. Get involved by
sending a mail to Prof. Andreas Rauber and Projektass. Martin Weise.
## Data Ingest
## Usage
<figure markdown>
![Data ingest](images/data-ingest.svg)
<figcaption>Modes of data ingest</figcaption>
<figcaption>Figure 1: Modes of data ingest</figcaption>
</figure>
More [usage examples](../usage-overview/) include how to ingest datasets, data dumps, live data, etc.
## Limitations
!!! question "Do you miss functionality? Do these limitations affect you?"
We strongly encourage you to help us implement it as we are welcoming contributors to open-source software and get
in [contact](../contact) with us, we happily answer requests for collaboration with attached CV and your programming
experience!
\ No newline at end of file
......@@ -10,7 +10,7 @@ containing GPS-data `gps.csv` already uploaded in the `dbrepo-upload` bucket of
```shell
curl -X POST \
-d '{"filename":"gps.csv","separator":","}'
http://<hostname>:5000/api/analyse/determinedt
http://<hostname>/api/analyse/determinedt
```
This results in the response:
......
......@@ -10,7 +10,7 @@ Access tokens are needed for almost all operations.
=== "Terminal"
``` console
```shell
curl -X POST \
-d "username=foo&password=bar&grant_type=password&client_id=dbrepo-client&scope=openid&client_secret=MUwRc7yfXSJwX8AdRMWaQC3Nep1VjwgG" \
http://localhost/api/auth/realms/dbrepo/protocol/openid-connect/token
......@@ -18,18 +18,18 @@ Access tokens are needed for almost all operations.
=== "Python"
``` py
import requests
auth = requests.post("http://localhost/api/auth/realms/dbrepo/protocol/openid-connect/token", data={
"username": "foo",
"password": "bar",
"grant_type": "password",
"client_id": "dbrepo-client",
"scope": "openid",
"client_secret": "MUwRc7yfXSJwX8AdRMWaQC3Nep1VjwgG"
})
print(auth.json()["access_token"])
```python
from keycloak import KeycloakOpenID
# Configure client
openid = KeycloakOpenID(server_url="http://<hostname>/api/auth",
realm_name="dbrepo", client_id="dbrepo-client",
client_secret_key="MUwRc7yfXSJwX8AdRMWaQC3Nep1VjwgG")
# Get Token
token = openid.token("username", "password")
access_token = token['access_token']
refresh_token = token['refresh_token']
```
## Refresh Access Token
......@@ -38,7 +38,7 @@ Using the response from above, a new access token can be created via the refresh
=== "Terminal"
``` console
```shell
curl -X POST \
-d "grant_type=refresh_token&client_id=dbrepo-client&refresh_token=THE_REFRESH_TOKEN&client_secret=MUwRc7yfXSJwX8AdRMWaQC3Nep1VjwgG" \
http://localhost/api/auth/realms/dbrepo/protocol/openid-connect/token
......@@ -46,15 +46,15 @@ Using the response from above, a new access token can be created via the refresh
=== "Python"
``` py
import requests
```python
from keycloak import KeycloakOpenID
# Configure client
openid = KeycloakOpenID(server_url="http://<hostname>/api/auth",
realm_name="dbrepo", client_id="dbrepo-client",
client_secret_key="MUwRc7yfXSJwX8AdRMWaQC3Nep1VjwgG")
auth = requests.post("http://localhost/api/auth/realms/dbrepo/protocol/openid-connect/token", data={
"grant_type": "refresh_token",
"client_id": "dbrepo-client",
"client_secret": "MUwRc7yfXSJwX8AdRMWaQC3Nep1VjwgG",
"refresh_token": "THE_REFRESH_TOKEN"
})
print(auth.json()["access_token"])
# Get Token
token = keycloak_openid.refresh_token(refresh_token)
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment