Skip to main content

BYU Open Authentication

Allows any Mendix application to gain access to any BYU API

Documentation

Description

This module allows applications to access API that have been published on the BYU API Store.

Typical Usage Scenario

You would use this module when you want to get the contact information for a student. This module will facilitate that process of communicating with the BYU API endpoint. If you're hitting an API that has been published on the BYU API Store then you will need to use this module.

How to Use

  1. Navigate to the folder _USE_ME / Pages
  2. Add the OAuth_Configuration snippet to a page
    OAuth Configuration layout
  3. Each application will have a Client ID and a Client Secret which allow you to get a client token. The client token allows you to receive information from an individual API
    1. Note: There are two grant types. Refer to the section "Grant Types" for specific instructions.
      • The "Client Token" represents the client credentials grant type. When using this method you only need to input the Client ID and Client Secret.
      • The "Personal Tokens" represents the authorization code grant type. When using this method you need to input the Callback URI as well.
        Client Token and Personal Tokens
  4. To find the Client ID and Client Secret go to the BYU API store
  5. Login using your BYU Net ID
  6. Navigate to the My Subscriptions tab
    1. Here you will find the Consumer Key, Consumer Secret, and Access Token
      BYU API Store
  7. Enter the Consumer Key as the Client ID
  8. Enter the Consumer Secret as the Client Secret
  9. Click save
  10. Click Get Client Token and it will generate a token

    Grant Types

    Currently, this module supports two OAuth 2.0 grant types:

    • Authorization Code
      • Calls an API on behalf of the user
    • Client Credentials
      • Calls an API on behalf of the application

    Each grant type has a unique set of instructions. This section will show you how to use the given microflows and snippets for each grant type.

    • Authorization Code (Personal Tokens):
      1. Add "ASu_PersonalToken_StartCallbackRH" to a startup microflow
      2. Add the snippet "OAuth_RedirectForPersonalTokenMaybe" to the home page. After logging in, the user will be redirected to get their personal token.
      3. Add "ACT_PersonalToken_GetToken" before making the REST request.
    • Client Credentials (Client Token):
      1. Add "ACT_ClientToken_GetToken" before making the REST request

    Dependencies

    Installation

      1. Download the module here. It will save as BYUOpenAuthentication.mpk
        1. Note: If you are using Mendix Studio Pro 8.8.* or 8.9.* downloading private app store modules/widgets was turned off due to security concerns. All the BYU Private App Store content can still be downloaded from the Company Content page in the Mendix App Store and then imported into those versions of Studio Pro. Upgrading to a newer version of Mendix Studio Pro fixes the problem.
      2. After the download finishes, import BYU Open Authentication into your project.
        1. Right click on your Project Explorer
        2. Select Import Module Package
        3. Select the module you just downloaded and click Open

      More Resources

      Slack

      For additional help, refer to the appropriate slack channels in their respective workspaces:

      1. BYU-OIT workspace
        1. #api-management
        2. #mendix
      2. BYU-Web workspace
        1. #mendix-user-group