The official BreadButter .NET API library.
Via command line:
nuget install BreadButter
Via Package Manager:
PM> Install-Package BreadButter
Via Visual Studio:
- Open the Solution Explorer.
- Right-click on a project within your solution.
- Click on Manage NuGet Packages...
- Click on the Browse tab and search for "BreadButter".
- Click on the BreadButter package, select the appropriate version in the right-tab and click Install.
-
Prior to coding, some configuration is required at https://app.breadbutter.io/app/#app-settings.
-
For the full Developer Documentation please visit: https://breadbutter.io/api/
APP_ID
can be found in App SettingsAPP_SECRET
is configured at App SecretsBREADBUTTER_API_ENDPOINT
should be set tohttps://api.breadbutter.io
Create a new instance of BreadButter
.
using BreadButter;
using BreadButter.Model;
BreadButterClient client = new BreadButterClient(baseUrl: "{BREADBUTTER_API_ENDPOINT}", appId: "{APP_ID}", appSecret: "{APP_SECRET}");
The StartAuthentication function in the JS library begins the Bread Butter managed login process.
Further documentation on starting the login process via our JavaScript client can be found at our GitHub page here
The following example demonstrates what to do once the Callback Url
has been used by our system to redirect the user back to your page:
using BreadButter;
using BreadButter.Model;
//NOTE: depending on what flavor of .NET you are using (Asp.Net, .net Core, .NET Framework), this could be slightly different
var authToken = Request.Query["authentication_token"];
GetAuthenticationResponse response = client.GetAuthenticationAsync(authToken);
var authData = response.auth_data;
var email = authData.email_address;
var firstName = authData.first_name;
var lastName = authData.last_name;
var profileImage = authData.profile_image_url;