Posts

Showing posts with the label authentication

Hyperledger Composer Rest Server connection with Cloudant

Hyperledger Composer Rest Server connection with Cloudant I'm trying to use Cloudant NoSQL DB as a persistent data source for my blockchain identities in my composer rest server. I have the composer-rest server setup in multiuser mode and is using google OAuth for authentication. I have looked at this question (Hyperledger Composer Rest Server connection with Cloudant NoSQL DB) but I'm still experiencing problems. If I do a composer card list in my terminal I can see the cards in my cloudant database. However, if I do a http get method from my rest server it returns an empty array. I have the COMPOSER_DATSOURCES variable set to {"db": { "name": "db", "connector": "cloudant", "username": "83bcdcfc-327b-xxxxxxxxxxxxx4e0ba4a9-bluemix", "password": "01e6d7xxxxxxxxxxxxxxxxb29adcc85ab35ce9ba", "database": "wallet" } } In cloudant, I have one database called wallet ...

Basic Authentication in spring boot using spring-boot-starter-security is not working for latetst version of spring-boot-starter-parent

Basic Authentication in spring boot using spring-boot-starter-security is not working for latetst version of spring-boot-starter-parent I am trying to implement basic auth to my end points of my micro-services. So I used spring-boot-starter-security. But I have noticed that spring-boot-starter-security does not work with spring-boot-starter-parent-version > 2.0.3. So I switched to spring-boot-starter-parent-version > 1.5.2 where it was working perfectly for my reference project. Can any one help me with any other method for implementing basic auth with latest version of spring-boot-starter-parent? My problem now is some class where I have written my logic, which is implemented in the latest version, are not functional with the former version of spring boot-starter-parent. Especially where there are methods for reading time stamps. Here is my pom.xml for reference. <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/...

PHP register check for user in database [closed]

PHP register check for user in database [closed] I created a function that checks for user in database but when I type the email that exists, it returns the message, and then, on second try can't proceed to register function, can't get rid of error, here is my try: if(!filter_var($email, FILTER_VALIDATE_EMAIL)) { $email_error = "Invalid email format"; } else if($user->doesUserExist($email) > 0) { $email_error = "Email is already taken"; } else { $email_error = ""; } if(empty($error) && empty($email_error) && empty($confirm_password_error)) { $user->register($username, $name, $email, $password); } It's not problem with register function. Here are the class functions: public function doesUserExist($email) { $query = "SELECT count(*) FROM users WHERE email = :email"; $stmt = $this->connection->prepare($query); $stmt...

redirect after login and logout

redirect after login and logout I don't how how chang path to redirect my website after login and logout. In first example I found that I must change RedirectIfAuthenticated . But If I have RedirectIfAuthenticated public function handle($request, Closure $next, $guard = null) { if (Auth::guard($guard)->check()) { return redirect()->route('myroute'); } return $next($request); } which doesn't redirect me when I want it to. And where can I change the redirect place after logout? post your controller please. – Adnan Mumtaz Jul 2 at 6:40 Which controller? – MrBelongsTo Jul 2 at 7:17 Login controller – Adnan Mumt...

How to check if web service is available without using credentials

How to check if web service is available without using credentials I have a WPF app written in c# and it is supposed to work in offline and online both. I have a class that checks for connectivity to web service using following skeleton code :- var url = "https://somesite.com/mywebservice.svc"; var myRequest = (HttpWebRequest)WebRequest.Create(url); var response = (HttpWebResponse)myRequest.GetResponse(); if (response.StatusCode == HttpStatusCode.OK) { Debug.Write(string.Format("{0} Available", url)); } else { // error } The issue is the web service requires authentication and hence an "unauthorized" exception is always thrown. Although the exception means the service is available but it is logged at network level and causes security alarm as the check is every 10 seconds. Is there a way to check the authenticated service availability without u...

Twitter api redirect to empty page

Twitter api redirect to empty page In this page: http://branding.cumedia.tv/login.php There are four logging options. All works fine except twitter. They redirects to the profile page, but redirects to an empty page. Why is that? Here is the code for the login page: else if (isset($_GET['method']) && $_GET['method']=='twitter_brand'){ //Successful response returns oauth_token, oauth_token_secret, user_id, and screen_name $connection = new TwitterOAuth($config_twitter_id, $config_twitter_secret, $_SESSION['token'] , $_SESSION['token_secret']); $access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']); if($connection->http_code == '200') { //Redirect user to twitter $_SESSION['status'] = 'verified'; $_SESSION['request_vars'] = $access_token; //Insert user into the database $user_info = $connection->get('account/verify_credentials'); $name = explo...

Nest js cannot resolve dependencies. in Auth service

Nest js cannot resolve dependencies. in Auth service Nest can't resolve dependencies of the AuthService (?). Please verify whether [0] argument is available in the current context. Please find my project repository Nest-auth-test Error: Nest can't resolve dependencies of the AuthService (?). Please verify whether [0] argument is available in the current context. at Injector.lookupComponentInExports (/home/arpit/Documents/aquaapp/node_modules/@nestjs/core/injector/injector.js:129:19) at <anonymous> at process._tickCallback (internal/process/next_tick.js:182:7) at Function.Module.runMain (internal/modules/cjs/loader.js:697:11) at Object.<anonymous> (/home/arpit/Documents/aquaapp/node_modules/ts-node/src/_bin.ts:177:12) at Module._compile (internal/modules/cjs/loader.js:654:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10) at Module.load (internal/modules/cjs/loader.js:566:32) at tryModuleLoad (internal/mod...

React authentication flickering issue in changing route

React authentication flickering issue in changing route I'm building several application in react , the last one is a admin panel so my react app must have authentication, absolutely all of my products used Server Side Rendering . react react Server Side Rendering For The last case, back-end team use pass me Token for handling authorization, they technologies are Java , Spring , Redis and etc base. Token Java Spring Redis When I send username and password to their server, If the information be correct, they send for me token and something else, I store it in localStorage and change the root state of react application as login, because of this change app use a different routing . username password token localStorage state react routing Everything looks good but what happen when I refresh the page? here the issue will happen, the login state is false so app goes to login page, in componentDidMount I read the localStorage and find out Oah! I got the token before and th...