# Overview

Unfurl Connect is a lock-aware identity provider – think “Connect with Google”, but Unfurl allows gated access based on [Unlock](https://unlock-protocol.com/) membership tokens.

So, as a user, you are allowing access, not to your photos, but to your on-chain entitlements (e.g. "Basic" or "Pro" subscription)

As a client, you get super-easy, slick experience gating access via memberships. Unlock makes this possible.

### Motivation

Unfurl Connect was born out of my desire for a platform/framework/language-independent way to use Unlock. The vision for users being Unlock subscriptions on your smart TV. The vision for services is a 30-minute setup to start taking Crypto for subscriptions services regardless of technology – even if the service didn’t previously have authentication.

### Guides: Jump right in

Follow our handy guides to get started on the basics as quickly as possible:

{% content-ref url="/pages/3tfnEVXCBsGFaIzHLE2r" %}
[Quickstart](/guides/quickstart)
{% endcontent-ref %}

{% content-ref url="/pages/o7Ot0lJT5h0qU02ZSXwJ" %}
[Easy Integration](/guides/easy-integration)
{% endcontent-ref %}

### Fundamentals: Dive a little deeper

Learn the fundamentals of Unfurl to get a deeper understanding of our main features:

{% content-ref url="/pages/pyJxVsnFVijMdARi4k16" %}
[Branding](/guides/branding)
{% endcontent-ref %}

{% content-ref url="/pages/pFNoKKLMIAcQm1VqiydY" %}
[Advanced Configuration](/guides/advanced-configuration)
{% endcontent-ref %}

{% content-ref url="/pages/shSUxxqnro2mdfqxSB6v" %}
[Self-hosting the IdP](/guides/self-hosting-the-idp)
{% endcontent-ref %}


# Quickstart

### Sign up

First, sign up as a user by going [here](https://unfurl-connect.com/register/user/). You can sign in using Web3 and connecting a wallet account. You will be able to add other wallet accounts later and link social logins to your user.&#x20;

### Client Configuration

You will receive a `client id` and a `client secret` by going [here](https://unfurl-connect.com/register/client/), or clicking on "connect your app".

You can then map existing locks to access roles, but the only thing you have to do is set a `redirect uri`. Other options are described within [Branding](/guides/branding) and [Advanced Configuration](/guides/advanced-configuration).


# Easy Integration

All code for our examples clients can be found on [Github](https://github.com/Unfurl-Connect/example-clients).


# Browser Only

Often authentication and authorization are done between client and server. Here we look at ways clients can use Unfurl that do not require the client appincation to have (or simply not use) a server. &#x20;

### Javascript

#### [oidc-client.js](https://github.com/IdentityModel/oidc-client-js/wiki)

This popular library for writting oidc clients in javascript only requires basic configuration and a few lines of code -- like so.&#x20;

```javascript
import Oidc from 'oidc-client';

const mgr = new Oidc.UserManager({
  authority: 'https://auth.unfurl-connect.com',
  client_id: 'YOUR_CLIENT_ID',
  redirect_uri: 'ONE_OF_YOUR_REDIRECT_URIs',
  response_type: 'code',
  scope: 'openid roles',
  loadUserInfo: true
});
/* Then sign-in like so: */
mgr.signinRedirect({useReplaceToNavigate:true});
```

However, a full example can be found [here](https://github.com/Unfurl-Connect/example-clients/blob/main/browser/oidc-client.html).&#x20;


# Client Server

Although not necessary, authentication and authorization are typically done between client and server. Here we look at ways clients can use Unfurl in this way. &#x20;

### Node.js

#### [express-openid-connect.js](https://github.com/auth0/express-openid-connect)

```javascript
const { auth } = require('express-openid-connect');
app.use(
  auth({
    issuerBaseURL: 'https://auth.unfurl-connect.com',
    baseURL: 'https://YOUR_APPLICATION_ROOT_URL',
    clientID: 'YOUR_CLIENT_ID',
    secret: '***********************',
    response_type: 'code',
    response_mode: 'form_post',
    scope: 'openid offline_access roles',
    claims: {
      id_token: {"roles": { "essential" : true } }
    }
  })
);
```

There is no client code. Logging in is done by navigating the user to `/login`.

A full example can be found [here](https://github.com/Unfurl-Connect/example-clients/tree/main/express-openid-connect).&#x20;


# Cloud Services


# Google Cloud Platform

First, add Unfurl as an [Identity Provider](https://cloud.google.com/identity-platform/docs/web/oidc#configuring_the_provider). Then it's just these *three* lines in your app.

```javascript
const provider = new firebase.auth.OAuthProvider('oidc.unfurl');
provider.addScope("roles");
firebase.auth().signInWithPopup(provider);
```

A full example page can be found [here](https://github.com/Unfurl-Connect/example-clients/blob/main/browser/gcp.html).


# Amazon Web Services

Coming soon


# Mobile

Mobile clients have not yet been tested, but OIDC identity providers are commonly used and Unfurl is fully compliant.

If you are a mobile developer, please contact us.


# Android


# iOS


# Branding

Branding can be configured on the [client settings page](https://unfurl-connect.com/register/client/).&#x20;

You can set a name and logo that will be used to idenifty your client on the consent page. Additonally, you can set a link to your terms of service and privacy policy to put users at ease. This information is also availible programatically.&#x20;


# Self-hosting the IdP

We will soon be releasing a docker deployment of Unfurl that will allow you to easily deploy your own identity provider with configurable clients should our service cease.


# Advanced Configuration

Being OpenID Connect compliant means clients are highly-configurable (full list of [client options](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#client-metadata) with descriptions). However, not all are currently exposed in the client dashboard. If you need ones that aren't exposed, please [contact us](mailto:david@unfurl-connect.com). &#x20;


# Roadmap

### More Examples

Unfurl works across a wide range of existing software and devices, but a little guidance goes a long way to saving you time. We aim to expand our current bevy of examples and how-tos.

### More Login Options

Currently, we support Google and Web3 sign-in to Unfurl for users. We are looking to expand to Twitch and Apple in the near future. We may also support Twitter and Github soon.

If your wallet has any issues with login, let us know.&#x20;

### Self-hosting

We will soon be releasing a docker deployment of Unfurl that will allow you to easily deploy your own identity provider with configurable clients should our service cease.

{% hint style="info" %}
**Community lead:** if you want something else on the roadmap, let us know!
{% endhint %}


# Projects

You can find our community projects on [Github](https://github.com/Unfurl-Connect).

* [Example Clients](https://github.com/Unfurl-Connect/example-clients)


