Giter VIP home page Giter VIP logo

scalatra-bootstrap's Introduction

Scalatra API With Okta Authentication

This is a starter application for anyone who wants to write an API layer using Scalatra. Why start here? If you're serious about API development, you'll have configs to load, JSON will be necessary, and security will be paramount. Instead of using the Scalatra project generator, clone this repository for a head start. This app demonstrates how to return JSON, verify the origin and authorization Token.

Application Features

Instead of the vanilla scalatra project generator, use this project to gain the following functionality out of the box:

Configuration

In the src/main/resources folder, there is a resource.conf file that looks like this:

base_url = "localhost"

okta {
    domain: "yourOktaDomain"
    audience: "api://default"
    timeout: 1000
}

Copy the contents of that file, name it application.conf, and replace your Okta domain.

Build & Run

$ cd back-end
$ sbt
> jetty:start
> browse

If browse doesn't launch your browser, manually open http://localhost:8080/ in your browser.

If actively developing, use to have sbt watch for changes.

~;jetty:stop;jetty:start

Additional Notes

Okta has great tutorials around Spring and generic java. I thought it might be useful to have a scala based example.

Contributing

Feel free to make a pull request if you add basic functionality that would help a fledgling API on its way to being production ready.

:)

scalatra-bootstrap's People

Contributors

saymv avatar

Stargazers

 avatar  avatar  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.