Open Rajshah1897 opened 3 years ago
If you clone this repository, you should create a testenv
file (that's it, no extension) in the root directory of the cloned repo.
I changed it here.
is that ok? Please see that image as below. where is the root directory in this pic? Do I need to create testenv file inside the resource server?
The testenv
file should be in the same directory as config.js
.
Ok Do I need to update anything in config.js?
No. It should read your values and override what's configured in there.
Ok Do I need to setup testenv should be testenv.js? like that?
No, it should just be named testenv
. It should not have a .js
extension.
Ok
Now what is the next step after this? I can not see any front end samples in your prerequisite
That's it. That's the demo! Front end samples are at:
Ok I got the error as below.
Error: Cannot find module 'dotenv' Require stack:
node scripts/startResourceServer.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @okta/samples-js-angular@0.0.3 resource-server script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?npm ERR! A complete log of this run can be found in: npm ERR! /Users/shahr/.npm/_logs/2020-09-16T19_50_59_123Z-debug.log shahr@US3RAPM0CD1EYMD samples-js-angular-master %
@mraible can you please share the screenshots? how it looks like in UI? and what I am missing here? there is not enough information or may be I am missing something.
You need to run npm install
first.
Ok run npm install and it is successfully run now but how to connect front end samples and what is the front end file name? and how to run both in terminal?
It looks like you have the resource server running. Open a new terminal and cd into the “custom-login” directory. Then, run “npm start”.
On Sep 16, 2020, at 5:23 PM, Rajshah1897 notifications@github.com wrote:
Ok run npm install and it is successfully run now but how to connect front end samples and what is the front end file name? and how to run both in terminal?
https://user-images.githubusercontent.com/31449505/93402181-a56e6d00-f849-11ea-8fdc-34c290510d9f.png — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/okta/samples-nodejs-express-4/issues/93#issuecomment-693717891, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAELZHK6CC6P5AV75HBSGLSGFCGDANCNFSM4RPBB7UQ.
Ok I did it and it was successfully run but when I checked localhost:8080 I got 400. Here is there screenshots as below.
Pease check testenv file are good?
1- customer-login
2.resource-server
Browser output
If you copy the link from your browser, you'll see the "redirect_uri" it's sending. Add that as a login redirect URI in your app and that should work. If it doesn't, please let us know.
On Sep 16, 2020, at 18:51, Rajshah1897 notifications@github.com wrote:
Ok I did it and it was successfully run but when I checked localhost:8080 I got 400. Here is there screenshots as below.
Pease check testenv file are good?
1- customer-login
2.resource-server
Browser output
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
No same thing I used that URI http://localhost:8080 after login my okta account it is showing me 400 error. Please find as below screenshots and also check the testenv file. should I need to create testenv file into both? resource-server and custom-login folder? and both should be same?
system log
Can you copy / paste the URL from your browser when you see the error? Add it as a comment here please.
On Sep 16, 2020, at 19:09, Rajshah1897 notifications@github.com wrote:
No same thing I used that URI http://localhost:8080 after login my okta account it is showing me 400 error. Please find as below screenshots and also check the testenv file. should I need to create testenv file into both? resource-server and custom-login folder? and both should be same?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
Also let me know testenv files are ok or not for both folder? Is it same for both?
Can you try adding http://localhost:8080/login/callback http://localhost:8080/login/callback as a Login redirect URI for your Angular app on Okta?
On Sep 16, 2020, at 7:14 PM, Rajshah1897 notifications@github.com wrote:
Also let me know testenv files are ok or not for both folder? Is it same for both?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/okta/samples-nodejs-express-4/issues/93#issuecomment-693749069, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAELZCYJ3GGGUIAX5ITC3DSGFPJHANCNFSM4RPBB7UQ.
The error as below after hitting this URL
Also I am not understanding where I need to use this Issuer and client id and which file? because right now I just removed the testenv file from my current folder and there is no change if I am adding this or not adding this. Please write the all steps and how to config in resource-server and custom-login. it is kind of confusing.
**These values must exist as environment variables. They can be exported in the shell, or saved in a file named testenv, at the root of this repository. (This is the parent directory, relative to this README) See dotenv for more details on this file format.
ISSUER=https://yourOktaDomain.com/oauth2/default CLIENT_ID=123xxxxx123**
Does it work in an incognito window?
The steps that we currently have make sense to me. Can you please offer a suggestion about how to make them better?
On Sep 16, 2020, at 23:17, Rajshah1897 notifications@github.com wrote:
The error as below after hitting this URL
Also I am not understanding where I need to use this Issuer and client id and which file? because right now I just removed the testenv file from my current folder and there is no change if I am adding this or not adding this. Please write the all steps and how to config in resource-server and custom-login. it is kind of confusing.
**These values must exist as environment variables. They can be exported in the shell, or saved in a file named testenv, at the root of this repository. (This is the parent directory, relative to this README) See dotenv for more details on this file format.
ISSUER=https://yourOktaDomain.com/oauth2/default CLIENT_ID=123xxxxx123**
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
Yes it is working fine as below. Please confirm.
Also I have a questions about testenv that is still I am not getting I did not use that file in my current repository so how they will take my profile? did you do something at your end? and how?
Please find the screenshots as below.
No testenv in my repository
The testenv
file is in the custom-login's parent directory and the webpack configuration is smart enough to look there. If you didn't have this file there, it wouldn't work.
Also I need to know how the same application work to generate the token? like machine to machine? Here we are tested with SPA. but I need to know machine to machine.
Please see Secure Server-to-Server Communication with Spring Boot and OAuth 2.0 for server-to-server.
ISSUER=https://yourOktaDomain.com/oauth2/default SPA_CLIENT_ID=123xxxxx123
In which file we need to add the above field? not understand testenv