Skip to content

Commit

Permalink
Merge pull request #153 from superfaceai/update/end-user-auth
Browse files Browse the repository at this point in the history
update: end user auth
  • Loading branch information
martyndavies authored Jan 31, 2024
2 parents 32d04c2 + 16fd688 commit 6b62c6e
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/gpts/first-time-users.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,26 @@

After creating your Superface account, you will be directed to your GPT Actions configuration page.

If this is your first time using Superface, you will see the getting started guide.
## Add a tool

In order to properly connect Superface to your GPT, you will need to have at least one tool installed. To get you moving quickly you can add the [Wttr.in](https://wttr.in) tool directly from this page by clicking **+ Add**.

![First time users will see this getting started guide](/img/gpts/firstrun-no-tools.png)

## Schema URL & Authentication

Once the tool has been added, the page will refresh with the configuration details you need to connect your OpenAI custom GPT to Superface via an Action.

![After adding the tool the page will refresh with schema information.](/img/gpts/firstrun-tool-added.png)

## User Authentication

Additionally, you will need to choose the type of authentication you want Superface to use. The default is **Use my credentials**. You can find out more about using **User-provided credentials** in the [User Authentication guide](./user-authentication.mdx).

![User authentication choice](/img/gpts/gpt-user-authentication-choice.png)

## Test your GPT with Superface

At this point you will need to head to the configuration of your custom GPT, and [set up your GPT Action](./setup). Once this is completed you can test your connection with Superface.

![Waiting for a connection from OpenAI to come through.](/img/gpts/firstrun-try-it.png)
Expand Down
43 changes: 43 additions & 0 deletions docs/gpts/user-authentication.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# User Authentication

Superface allows you to connect to external APIs and SaaS platforms in two ways.

1. **Using your own credentials**. This is good for personal GPTs or where you are happy to share that access with others.
2. **User-provided credentials**. This will ensure that the end users of your GPT can supply their own credentials in order to access a specific API or platform.

This guide covers **User-provided credentials**.

## Selecting User Authentication

In your account you can select which authentication type you want to use for your GPT, and you can edit this at any time by clicking on **GPT Actions**.

![The authentication type selector in the GPT Actions setup page](/img/gpts/gpt-user-authentication.png)

Your authentication choice will be automatically saved.

## Authentication flow for users

With **Use GPT user-provided credentials** selected, the users of your GPT will need to login, or supply their own API keys, to access use the tools you have added to Superface.

The flow for that authentication works like this:

1. A user of your GPT writes a prompt (requesting a list of chats from [Microsoft Teams](../tools/microsoft-teams), for example).
2. Superface responds with a message asking them to configure the tool for themselves by providing their account information (show below).

![The response from Superface in a GPT](/img/gpts/gpt-prompt-userauth.png)

3. The user clicks the link to provide their authentication. This will open a new window for the authentication service provided by Superface.

![The Superface authentication window](/img/gpts/gpt-user-login.png)

4. After authenticating successfully, the user will redirected back to the authentication page.

![A successful authentication](/img/gpts/gpt-user-loggedin.png)

The user can now confirm that the required authentication is in place and their original prompt will be re-tried.

:::note Authentication expiration

Superface uses a temporary ID provided by OpenAI to recognize the users of your GPT. This ID is valid for up to 24 hours, but can expire at any time. If the ID expires, the user must provide their credentials again.

:::
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ module.exports = {
collapsed: false,
items: [
'gpts/setup',
'gpts/user-authentication'
//'gpts/limits'
]
},
Expand Down
Binary file added static/img/gpts/gpt-prompt-userauth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/gpts/gpt-user-authentication.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/gpts/gpt-user-loggedin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/gpts/gpt-user-login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6b62c6e

Please sign in to comment.