Giter Site home page Giter Site logo

samples-js-angular-1's Introduction

Angular 1 Samples (Deprecated)

Note: This repository is Deprecated.

Okta is not offering updates to this AngularJS (Angular 1) sample.

Table of Contents (Deprecated)

Introduction

This repository contains the Angular 1 front-end code that can be used along with back-end server samples.

Note: This Angular sample application is only compatible with our Express Sample Application. If you are using a different sample for the back-end or resource server, please check out the 1.10.0 version of this repository.

Please continue to visit https://developer.okta.com to learn about new documentation and sample applications.

Using the built-in Express server

To run this sample:

  1. Clone this repository and navigate to the new directory.

    git clone [email protected]:okta/samples-js-angular-1.git
    cd samples-js-angular-1
  2. Install the required dependencies.

    npm install
  3. Run the mock Okta server. If you're interested in testing this sample against your own Okta org, follow the steps in the Express Quick Start.

    npm run mock-okta
  4. In a different terminal window, run the Express server.

    npm start
  5. You're all set! Open a browser window to http://localhost:8080.

Note: Use chrome browser if you're running the mock-okta server, to test the sample.

Using your own Okta org

You can create your own Okta org by signing up for a free Developer Account

If you'd like to test this sample against your own Okta org, navigate to the Okta Developer Dashboard and follow these steps:

  1. Create a new Web application by clicking Add Application and selecting Web from the Applications page.
  2. After accepting the default configuration, click Done to redirect back to the General Settings of your application.
  3. Copy the Client ID and Client Secret, as it will be needed for the client configuration.
  4. Finally, navigate to https://{yourOktaDomain}.com/api/v1/authorizationServers/default to see if the Default Authorization Server is setup. If not, let us know. Then, replace the oidc settings in .samples.config.json to point to your new app:
// .samples.config.json
{
  "oidc": {
    "oktaUrl": "https://{{yourOktaDomain}}.com",
    "issuer": "https://{{yourOktaDomain}}.com/oauth2/default",
    "clientId": "{{yourClientId}}",
    "clientSecret": "{{yourClientSecret}}",
    "redirectUri": "http://localhost:8080/authorization-code/callback"
  }
}

Stop the mock-okta server and Express server if you're running it.

Open a new terminal window, and run the Express server.

npm start

You're all set! Open a browser window to http://localhost:8080.

Support

Have a question or see a bug? Email [email protected]. For feature requests, feel free to open an issue on this repo. If you find a security vulnerability, please follow our Vulnerability Reporting Process.

License

Copyright 2017 Okta, Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

samples-js-angular-1's People

Contributors

jmaldonado-okta avatar jmelberg-okta avatar lboyette-okta avatar mystiberry-okta avatar nbarbettini avatar oktauploader-okta avatar rchild-okta avatar robertjd avatar swiftone avatar vijetmahabaleshwar-okta avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

samples-js-angular-1's Issues

Frontend build script fails on Windows

From okta/samples-nodejs-express-4#18

I tried this with

node --version
v7.9.0

on Windows 10. The result:

C:\Users\Nate\Documents\code\samples-js-angular-1 [master ≡]> node .\scripts\build-frontend.js
'DIST_OUT' is not recognized as an internal or external command,
operable program or batch file.
child_process.js:524
    throw err;
    ^

Error: Command failed: DIST_OUT=C:\Users\Nate\Documents\code\samples-js-angular-1\dist npm run build
    at checkExecSyncError (child_process.js:481:13)
    at execSync (child_process.js:521:13)
    at Object.<anonymous> (C:\Users\Nate\Documents\code\samples-js-angular-1\scripts\build-frontend.js:23:1)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:423:7)

Sample does not work for default auth. server without API AM enabled

For orgs that do not have API Access Management enabled, this sample will not work. I was able to get it to run with an org without API AM enabled by modifying tools/dev-server/route-handlers.js in the following ways:

// url: `${config.oidc.issuer}/v1/token?${query}`,
url: `${config.oidc.issuer}/oauth2/v1/token?${query}`,
  1. and later...
// url: `${config.oidc.issuer}/v1/keys`,
url: `${config.oidc.issuer}/oauth2/v1/keys`,
  1. and also update the value for the Issuer to be https://example.oktapreview.com instead of https://example.oktapreview.com/oauth2/default.

Would you add a warning in the README to notify folks that this sample requires an org with API Access Management enabled?

Broken link to 1.10

The readme says,

If you are using a different sample for the back-end or resource server, please check out the 1.10.0 version of this repository.

The link to 1.10.0 points to a branch that no longer exists. Is this info still relevant?

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.