Skip to content

Managing Applications

As a SolveBio developer, you have the ability to create new apps through the SolveBio API. This guide describes how to create, update, and delete your apps using the Python and R client libraries.

On SolveBio, applications (i.e. "apps"), represent unique OAuth2 credentials that enable a third-party system to obtain SolveBio access tokens on behalf of SolveBio users. By default, applications created on SolveBio are accessible only to users in the same organization.

Create Apps

Each time you create a new app, you will be granted a unique client ID. You can always retrieve a list of your apps (with their client IDs) in the future. The client ID is a critical part of the OAuth2 Authorization Code flow so make sure to copy it to a safe place.

1
2
3
4
5
6
7
8
from solvebio import Application

# Create the app (only do this once per application)
# using our standard Dash app OAuth2 redirect URL:
my_app = Application.create(name='My Dash App', redirect_uris='http://127.0.0.1:8050/_oauth-redirect')

# Print the app's client ID
print(my_app.client_id)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(solvebio)

# This URL (protocol, host, and port) must exactly match
# your local development URL.
redirect_uris <- "http://127.0.0.1:3838/"

# Create the app (only do this once per application)
# using our standard Shiny OAuth2 redirect URL:
my_app <- Application.create(name = "My Shiny App", redirect_uris = redirect_uris")

# Print the app's client ID
cat(my_app.client_id)

Update Apps

When you create your app, you need to supply one or more redirect URIs for security reasons. When moving from a local development environment to a production environment, the URI will likely change. Here's how to edit your redirect URIs:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
from solvebio import Application, User

# Retrieve my app (the first that matches the name, owned by the current user)
my_app = Application.all(name='My Dash App', user=User.retrieve().id).next()

# Add the 'write' scope
my_app.scopes = 'read write'
# Add the production redirect URI, but keep the development one
my_app.redirect_uris = """
http://127.0.0.1:8050/_oauth-redirect
https://my-app.my-dash-apps.net/_oauth-redirect
"""
my_app.save()
1
2
3
4
5
6
7
library(solvebio)

# Retrieve my app (the first that matches the name, owned by the current user)
my_app <- Application.all(name='My Shiny App', user=User.retrieve()$id)$data

# Add the 'write' scope and set the production redirect URI.
Application.update(my_app$client_id, scopes = "read write", redirect_uris = "https://my-app.my-dash-apps.net/_oauth-redirect")

Delete Apps

1
2
3
4
5
6
7
from solvebio import Application, User

# Retrieve my app (the first that matches the name, owned by the current user)
my_app = Application.all(name='My Dash App', user=User.retrieve().id).next()

# Delete the app
my_app.delete()
1
2
3
4
5
6
7
library(solvebio)

# Retrieve my app (the first that matches the name, owned by the current user)
my_app <- Application.all(name='My Shiny App', user=User.retrieve()$id)$data

# Delete the app
Application.delete(my_app$client_id)