Coder Social home page Coder Social logo

okta-react-azure-functions-example's Introduction

How to Build and Deploy a Serverless React App on Azure Example

This repository shows you how to build a Static Web App in React for Azure and how to add a Function in Azure for a serverless backend. Please read How to Build and Deploy a Serverless React App on Azure to see how it was created.

Prerequisites:

Okta has Authentication and User Management APIs that reduce development time with instant-on, scalable user infrastructure. Okta's intuitive API and expert support make it easy for developers to authenticate, manage and secure users and roles in any application.

Getting Started

To pull this example, first create an empty GitHub repo. Next run the following commands:

git clone --bare https://github.com/oktadev/okta-react-azure-functions-example.git
cd okta-react-azure-functions-example
git push --mirror {your git repo}
cd ..
rm -rf okta-react-azure-functions-example.git

Create an OIDC Application in Okta

Create a free developer account with the following command using the Okta CLI:

okta register

If you already have a developer account, use okta login to integrate it with the Okta CLI.

Create a client application in Okta with the following command:

okta apps create

You will be prompted to select the following options:

  • Application name: Azure-Static-App
  • Type of Application: 2: SPA
  • Callback: http://localhost:4280/login/callback
  • Post Logout Redirect URI: http://localhost:4280

The application configuration will be printed in the terminal. Note your issuer and your clientId.

Replace the instances of {yourOktaDomain} with the issuer domain from above in azure-static-app/src/AppWithRouterAccess.jsx and api/CreateBadge/index.js.

Replace the instance of {yourClientId} with the clientId from above in azure-static-app/src/AppWithRouterAccess.jsx.

Deploy your application

In the Azure Static Web Apps Visual Studio Code extension, click on Create Static Web App. Follow the prompts with the following values.

Azure Web App name azure-static-app GitHub repo azure-static-app Commit Message initial commit Region - Select the region closest to you Framework - React root of your app azure-static-app root of your api api build - leave this blank

Configure your Okta application with your new Azure Domain

In your Okta admin panle Naviagte to Security -> API Click on Trusted Origins Add your Azure domain to this list

Navigate to your Okta application Click Edit and add {yourAzureDomain}/login/callback to the Sign-in Redirect URIs and {yourAzureDomain} to Sign-out redirect URIs Click Save

Links

This example uses the following open source libraries from Okta:

Help

Please post any questions as comments on the blog post, or visit our Okta Developer Forums.

License

Apache 2.0, see LICENSE.

okta-react-azure-functions-example's People

Contributors

alisaduncan avatar nickolasfisher avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.