GithubHelp home page GithubHelp logo

sasjs / viyatoken Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 1.0 10.56 MB

SASjs web app for generating a Viya client, secret and access token

SAS 99.71% HTML 0.14% JavaScript 0.14% Shell 0.01% Dockerfile 0.01%
sasjs viya sas sasjs-app

viyatoken's Introduction

Gitpod ready-to-code

Viya Token Generator

TL;DR

Run the code below in SASStudioV, and open the link from the log in a browser, eg: YOURSERVER/SASJobExecution?_program=/Public/app/viyatoken/clickme

filename vt url "https://raw.githubusercontent.com/sasjs/viyatoken/master/runme.sas";
%inc vt;

If you don't have internet access from your SAS Compute instance, just copy paste the code directly into SASStudioV from https://raw.githubusercontent.com/sasjs/viyatoken/master/runme.sas.

NOTE - this will only work if your JobExecution service is running under an admin identity that can access the CONSUL token (ie, yours). If you have a pooled session, and this app works, then you have a security problem as your shared account has too much system access.

What is this?

As SAS Application Developers, we are frequently needing to generate client tokens. We also need an easy way for our customers to do the same.

So we built a SASjs app for it.

By default the app will be created in a /Public/app/viyatoken directory, if you'd like to change this, then modify the appLoc variable in the generated viyadeploy.sas program to a preferred location.

Prerequisites

  • NPM
  • SASjs

Once you have installed NPM, run npm i -g @sasjs/cli to get the CLI tool

Build Process

Clone the repo and cd into it (or, just click the gitpod link above). Then run sasjs cb viya. This will compile the assets from the src folder and build a deployment program under sasjsbuild. Run this program in SAS (must be StudioV in Viya) to create the services. The link will be at the bottom of the log.

viyatoken's People

Contributors

allanbowe avatar krishna-acondy avatar medjedovicm avatar sabhas avatar yuryshkoda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

allanprc

viyatoken's Issues

Not getting Clinet_id and Client secrete from SASjs Viya Token Generator

Hi,

I have run below code and created folders and trying to run "https://URL.../clickme. However, i am not getting any output for client_secrete to use submit jobs from VS Code editor.

filename vt url "https://raw.githubusercontent.com/sasjs/viyatoken/master/runme.sas";
%inc vt;

If you can able to join us for few mins over the call, that would be a great help to understand more on this usage and further steps.

Thanks again for all your help.

build issue after migration

We get the following message during the build:

Building for target viya
Error accessing file:  /private/tmp/viyatoken/node_modules/sasjs/index.js
An error has occurred when building web app services. Error: ENOENT: no such file or directory, open '/private/tmp/viyatoken/node_modules/sasjs/index.js'

Steps to reproduce:

git clone https://github.com/sasjs/viyatoken
cd viyatoken
npm install
sasjs cb

It seems that the CLI should be building the web streamer from node_modules/@sasjs/adapter instead of node_modules/sasjs

the .env variable names should be uppercase

In the generated tokens screen, the first set of name value pairs (for the .env file) are in lower case, eg:

access_token=
client=

These should all be in uppercase to be recognised by sasjs, eg:

ACCESS_TOKEN=
CLIENT=

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.