Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/molgenis/molgenis-r-auth

Discover and authenticate against an OpenID server from R
https://github.com/molgenis/molgenis-r-auth

jwt

Last synced: 29 days ago
JSON representation

Discover and authenticate against an OpenID server from R

Awesome Lists containing this project

README

        

---
title: "MolgenisAuth"
date: "`r Sys.Date()`"
output:
github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

[![Travis build status](https://api.travis-ci.com/molgenis/molgenis-r-auth.svg?branch=master)](https://api.travis-ci.com/molgenis/molgenis-r-auth.svg?branch=master)
[![CRAN status](https://www.r-pkg.org/badges/version/MolgenisAuth)](https://CRAN.R-project.org/package=MolgenisAuth)
[![codecov](https://codecov.io/gh/molgenis/molgenis-r-auth/branch/master/graph/badge.svg?token=5Y96e0ULTk)](https://app.codecov.io/gh/molgenis/molgenis-r-auth)

The goal of MolgenisAuth is to discover and authenticate against an OpenID
Connect server. We have tested it using [Fusion Auth](https://fusionauth.io/).

## Installation

You can install the released version of MolgenisAuth from [CRAN](https://CRAN.R-project.org) with:

```{r eval = FALSE}
install.packages("MolgenisAuth")
```

And the development version from [GitHub](https://github.com/) with:

```{r eval=FALSE}
# install.packages("devtools")
devtools::install_github("molgenis/molgenis-r-auth")
```
## Usage

To discover endpoint URLs on an OpenID Connect authentication server:

```{r discover endpoint URLs}
library(MolgenisAuth)
endpoint <- discover("https://auth.molgenis.org")
endpoint
```

Using this endpoint, you can then authenticate using the device flow.
This will open a browser window so you can authenticate with the
authentication server.
```{r}
credentials <- device_flow_auth(endpoint, "b396233b-cdb2-449e-ac5c-a0d28b38f791")
credentials$id_token
```

## Support
We appreciate help, so do not be shy and file pull-requests for things that are
broken or file a bug report.