text
stringlengths
64
2.99M
Looking at the source for UsernamePasswordAuthenticationToken, /** * This constructor can be safely used by any code that wishes to create a * <code>UsernamePasswordAuthenticationToken</code>, as the {@link * #isAuthenticated()} will return <code>false</code>. * */ public UsernamePasswordA...
To your second question first: there is no way to break/stop a promise chain, unless your callback throw err like doAsync() .then(()=>{ throw 'sth wrong' }) .then(()=>{ // code here never runs }) You can simply try below demos to verify the second callback still runs. doAsync() .then(()=>{ res....
You need to link your Facebook external login to your Google external login with your email by using UserManager.AddLoginAsync, you cannot register twice using the same adresse if you use the adresse as login. Check out the Identity sample on Identity github repo. https://github.com/aspnet/Identity/blob/dev/samples/...
First of all, every API request must go through https. Then you can "secure" user-specific APIs by giving each user a unique token which must be sent at every request. It is as well possible to check the host or useragent of the user which requests the API and allow only specific custom useragents (depending on your ...
The easy way: Map an activeSessionId field to your User class: /** * @ORM\Entity * @ORM\Table(name="fos_user") */ class User extends BaseUser { /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @ORM\Column(type="string",...
For 1, you can use the Code Injector plugin. See this question For 2, I failed to understand what you mean by "integrate the generated SchemaType class into the Schema class". For 3 - yes, with your own XJC plugin but it's probably a bit hard. :) A recommendation: use schema-derived classes as DTOs only, don't try t...
Hope this should help you. public void createUser() { final String randPassword = getRandonPassword(); final String userName= "someuser"; final String email = "someuser@example.com"; authenticationService.setAuthentication(userName, randPassword.toCharArray()); System.out.println(randPassword); ...
Ok this is my stripped out example which should illustrate the point: @Injectable() export class AuthGuardService implements CanActivate { toUrl; constructor(public authenticationService: AuthenticationService, public router: Router) { } canActi...
From the Source - the dynamic feature will ENABLE authentication on @PermitAll, not disable it. See this from AuthDynamicFeature: final boolean annotationOnClass = (resourceInfo.getResourceClass().getAnnotation(RolesAllowed.class) != null) || (resourceInfo.getResourceClass().getAnnotation(PermitAll.class...
Background: The Google .NET client library by default stores the credentials for the users in %AppData% the field where you have "user" is how its is storing it. Example: UserCredential credential; using (var stream = new FileStream(clientSecretsJsonFilePath ,FileMode.Open ...
This is an excellent start. These kind of questions are tricky and there is no way to prove these things secure. There are some good conceptual "pillars" to guide ones thoughs on it: The pillars of security: Privacy: This code does not provide it. An attacker in the middle can read the structure of the message and ...
Spotify API playlists endpoint requires authentication token. Very primitive example, in those lines you can get Auth Token: // use the access token to access the Spotify Web API request.get(options, function(error, response, body) { console.log(body); token = access_token; }); Then, your cod...
If you were developing with .Net Framework, the AcquireTokenAsync do provide the methed using the UserPasswordCredential. Here is the code sample for your reference: AuthenticationContext authenticationContext = new AuthenticationContext(UserModeConstants.AuthString, false); string resrouce = ""; string clientId = ""...
It all depends what you want and why you're asking, a little more context might be applicable: Do you want to monitor from a Clojure process, or do you want to monitor a Clojure process ? Which of these two processes do you have author control over ? JMX client clojure.java.jmx is a client library to call Java JMX fu...
Disclosure: I work at Auth0. Disclaimer: If you really set your mind on using Firebase from a practical point of view this might not help you as it focuses on what Auth0 provides to solve problems similar to the one you described. However, from a theoretical point of view this might help you so I deemed it worthwhile ...
I would like to suggest the following approach, 1. Create a column with the name tenant ID for each of the table that contains core business data this is not required for any mapping table. Use the approach B, by creating an extension method that returns an IQueryable. This method can be an extension of the dbset so ...
Actually, the basic authentication mechanism uses session to store the visitors identity so when you once get authenticated (providing credentials in a login form) the application doesn't ask for the password again when you visit another page after login. So, the session is used to keep the user's current state in the ...
There are two ways to access private user data with Google APIs. Strait Oauth2. where you have a consent for asking the owner of the account if you can access it Service accounts which are technically pre authorized by the developer. Normally I would say because you are only accessing the one account that you own,...
Note: I won't explain how to decrypt the data, but that should be rather easy to figure out using the code for encryption and the documentation-links provided. First of all, the user has to be able to select a file via an input element. <input type="file" id="file-upload" onchange="processFile(event)"> You ca...
Instead of using the CorsRegistry you can write your own CorsFilter and add it to your security configuration. Custom CorsFilter class: public class CorsFilter implements Filter { @Override public void init(FilterConfig filterConfig) throws ServletException { } @Override public void doFilter(Se...
JWT is just a token, not an authentication/authorization protocol. Using JWT can be secure or insecure it depends on how you use it. JWT is the native token used by OIDC. You're probably referring to the usual use of JWT as value tokens, which may be less secure than reference tokens. See here for a somewhat clearer ex...
As I'm not Rails expert so I can't go in too many details here. But to answer the I want some ideas question - from system architecture perspective you have 3 options: Front-end is Liferay and some functionalities are provided from external Ruby/Rails apps. Specific business logic can be developed in Ruby/Rails...
The issue is here: org.springframework.security.authentication.dao.DaoAuthenticationProvider User '' not found On the provided link slide 6 it says firing organizationFilter When you look into security filters. They are actually those static rules that I mentioned earlier. so something is of a conf...
There are three aspects to acting as a second user. 1. GitHub Account To use the GitHub web interface as another user (e.g. fork a repository, submit a pull request, post comments) you need to sign in to another account.* Tip: Switching between accounts is a pain because you have to sign out and sign in each time. Y...
HOWEVER, it seems to be accepted as law, that you don't perform computationally heavy tasks with Node as its a single thread architecture. I would reword this: don't perform computationally heavy tasks unless you need to with Node Sometimes, you need to crunch through a bunch of data. There are times when i...
It seems you need OWIN OAuth 2.0 Authorization Server. This is the Microsoft extension to add the required functionality. It creates an oauth endpoint (e.g. /token) that you can use to get a token. You don't have a controller directly, but there is a special OWIN class connected to it that you will need to extend to ad...
Have not tried Angular2. Though you should be able to set img src to Blob URL of first File object of input.files FileList. At chromium, chrome you can get webkitRelativePath from File object, though the property is "non-standard" and possibly could be set to an empty string; that is, should not be relied on for the ...
You can send Mails using Laravel Mail Class like this, Your controller should look like this: use Mail; class EmailsController { public function send(Request $request) { $email = $request->get('email'); Mail::send('emails.send', ['email' => $email], function ($message) use ($email) { $mess...
As per your new code: you have an extra bracket, again in , 256)));. Here: INSERT INTO `user` (`username`, `salt`, `passwordhash`) VALUES ('username', 'a1b2c3d4e5f6g', SHA2(CONCAT('password', 'a1b2c3d4e5f6g'), 256)); This and with all the comments I left up there. Edit: The following, as per going through the M...
The exception mentions: Encryption raised an exception. A possible cause is you are using strong encryption algorithms and you have not installed the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files in this Java Virtual Machine This answer only tries to fix that issue. I've written a...
Open settings.xml for your maven settings configuration and add here server with your credentials. Usually this file is located in .m2 folder so add here something like: <servers> <server> <id>docker-hub</id> <username>username</username> <password>password</p...
Your first problem is that you didn't ever actually use the func parameter to function_code... the code bytes from your indicated function never make it into the buffer. But fixing that won't get you very far, because there's a big problem with your whole approach. There's no guarantee made by either the C or C++ sta...
Can I use MemoryCache in an ITicketStore to store an AuthenticationTicket? Absolutely, here is the implementation that I have been using for nearly a year. app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationScheme = "App.Cookie", AutomaticAuthenticate = true, AutomaticChalleng...
You can write your own http message converter. Since you are using spring boot it would be quite easy: just extend your custom converter from AbstractHttpMessageConverter and mark the class with @Component annotation. From spring docs: You can contribute additional converters by simply adding beans of that type in...
You were on the right track with the code posted in your initial question. The IdentityServerAuthenticationOptions object has properties to override the default HttpMessageHandlers it uses for back channel communication. Once you combine this with the CreateHandler() method on your TestServer object you get: //build i...
Define an "effective one". While the three JavaScript snippets you did present do work, have you looked at ways to stop that? For example, in the iframe (which the attacker would control), add the sandbox attribute with an empty value: <iframe src="Inner.html" sandbox=""> iframe documentation Here is a samp...
There is a quite simple answer to how to encrypt files. This script uses the XOR encryption to encrypt files. Encrypt the file a second time to decrypt it. #include <iostream> #include <fstream> #include <string> using namespace std; void encrypt (string &key,string &data){ float percent; f...
Encrypt the passwords with the user's password which you do not store. That way the passwords are never stored, only transient in RAM while being used. On creation of a user use password_hash to save the users hashed password. When the user needs to save a 3rd party password for later use authenticate the user with p...
If we test this situation empirically, we will see, that everything longer than 117 bytes will fail: $msg = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm'; The line above represents 117 characters and 117 bytes in total. This works when encrypt...
Use the OpenIdConnectDefaults.AuthenticationScheme constant when you add the authorization policy and when you add the authentication middleware. Here you are using OpenIdConnectDefaults. Good. Keep that line. services.AddAuthorization(configuration => { ... configuration.AddPolicy("OpenIdConnect", new Au...
Here is another way to do this (Swift 3, Alamofire 4.x) using a DispatchGroup import Alamofire struct SequentialRequest { static func fetchData() { let authRequestGroup = DispatchGroup() let requestGroup = DispatchGroup() var results = [String: String]() ...
How to identify users You're not explicit about which database technology you use, but in general you should be able to use regular strings as identifiers/keys. You do mention that you're using SQL variant so that may be the source of the issue; you should probably use a more specific text-based data type with a fixed...
Even if it's possible, in my opinion it has some disadvantages. In general I like clients to be as simple as possible to avoid maintenance issues. Instead I'd route all client requests through a REST API on my app server. The disadvantages are not related to Kafka, but are common problems of native clients. Coupling Yo...
Instead of registering/removing service at runtime, i would create a service factory which decides right service at runtime. services.AddTransient<AuthenticationService>(); services.AddTransient<NoAuthService>(); services.AddTransient<IAuthenticationServiceFactory, AuthenticationServiceFactory>(); ...
The message says Host key verification failed. nothing about authentication, so you are working on the wrong field. It means that the host key of the bitbucket.org is not in your ~/.ssh/known_hosts and your client does not have any way how to verify it. It was answered many times how to workaround it, but how to ...
As for php encryption, there are several encryption methods available. So don't limit yourself to CI's library. For example: http://php.net/manual/en/function.mcrypt-encrypt.php But as to your question, CI is released under the MIT license with the following limitation: /** * Copyright (c) 2014 - 2016, British Columb...
I think you should try creating a AuthenticationEntryPoint implementation with multiple landing page support. It could be something like this: import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.security.core.AuthenticationExcep...
Unfortunately, you can only upload files using: Softlayer Object Storage Java Client (it's not possible to create objects), here an example for authentication, create container and upload a file using the client: package com.softlayer.objectstorage.main; import java.util.HashMap; import java.util.Map; import com.soft...
Bernd, you have a rather large set of technology moving parts here :-). Let me pick them into pieces: Domino: you need something outside of Bluemix for storing the NSF, like a Softlayer Domino server. That will be key to the solution. mobile app: Cordova is right, but look one step further and have a look at Ionic. I...
'Instant' derives from the term 'real-time'; client side code can be used to send requests to the server. Instant messaging applications are complex to write from scratch - there are plenty of things to take into consideration: Member registration and login (Session authentication) Messaging authentication (Role base...
It is definitely not the secure way of hardcoding them and just placing them in an app. Actually its not that straight forward. I assume you created the client from artisan or from the pre-built Vue components. In either case there is more that you have to do in order so safely consume the oauth2 api without exposing ...
The problem with Laravel 5.3 passport is that unlike previous OAuth 2.0 Server for Laravel library offered by lucadegasperi, it has no API to make clients directly. So as if now the client can only be made through the front-end. FYI we wanted to use laravel passport solely for our mobile app so while creating and regis...
If you mean data at app.config it is simple! You have to use these two classes: EntityConnectionStringBuilder https://msdn.microsoft.com/en-us/library/system.data.entityclient.entityconnectionstringbuilder(v=vs.110).aspx And SqlConnectionStringBuilder https://msdn.microsoft.com/en-us/library/system.data.sqlclient...
You should use an existing library that supports the type of JWT signature you're using. For a quick reference on your available options for PHP check the Libraries section in jwt.io. Using an existing library is preferred in most situations, however, it's also important to do some assessment on the quality of the lib...
In C, you cannot declare a function inside another function, like you did. Here is your code that will compile: #include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> #include <string.h> char *encryption (char []); void *decryption (char []); char alpha [26]={'a'...
Unfortunately, this workflow isn't well supported by existing Apache NiFi processors. You could probably fashion a workflow that split the JSON content into attributes, split each attribute into the content of an individual flowfile, encrypted that content, merged the flowfiles back, and reconstituted the now-encrypted...
There are various ways to do this but here is my recommendation // For ASP.Net MVC 5 simply inherit from AuthorizationAttribute and override the methods. public class AccessControlAttribute : Attribute, IAuthorizationFilter { private readonly Roles role; public AccessControlAttribute(Roles role) { thi...
1) How I can get that same device ID in client side application? You can call the following REST endpoint in order to retrieve from the server various data about the application, including the deviceId: http://www.ibm.com/support/knowledgecenter/en/SSHS8R_8.0.0/com.ibm.worklight.apiref.doc/rest_runtime/r_restapi_...
When I use [Authorize(Policy = "Bearer")] I get Token authorisation and when I used [Authorize] I get identity authorisation, how can I combine both? [sic] Set the ActiveAuthenticationSchemes property. It takes a comma separated list of scheme names. Here is an example that activates the cookie middleware that Ide...
If you're in a situation where the Cognito Javascript SDK isn't going to work for your purposes, you can still see how it handles the refresh process in the SDK source: You can see in refreshSession that the Cognito InitiateAuth endpoint is called with REFRESH_TOKEN_AUTH set for the AuthFlow value, and an object passe...
Original answer using git's start-ssh-agent Make sure you have Git installed and have git's cmd folder in your PATH. For example, on my computer the path to git's cmd folder is C:\Program Files\Git\cmd Make sure your id_rsa file is in the folder c:\users\yourusername\.ssh Restart your command prompt if you haven't a...
Using promises : .factory('AuthenticationService', ['Base64', '$http', '$cookieStore', '$rootScope', '$q', function (Base64, $http, $cookieStore, $rootScope, $q) { var service = {}; service.Login = function (username, password, callback) { var deferred = $q.defer(); var authdata = Base64.e...
Figure out what happens, respectively what should happen in the different situations, and create tests with proper expectations. Like on successful login, the user data is being set in the auth storage and a redirect header is being set, that's something you could test. Likewise on a non-successful login attempt, no u...
SimpleCov is a code coverage tool which is intended to be run on your local machine or a CI such as Travis CI. It should not be run on Heroku which is for production or staging. You should place simple_cov and any test related gems in the test group of your gemfile: group :test do gem 'simplecov', '~> 0.12.0' end ...
There are a few gotchas on the way. You can find all the needed info on stackoverflow. I have gathered all the info in this answer, for convenience. Things to be noticed I assume android kitkat and above. The intent for incomming sms is "android.provider.Telephony.SMS_RECEIVED" You can change the priority of the in...
You should not be using the bcrypt hash output as an encryption key; it is not meant to be key material: BCrypt is not a key-derivation function BCrypt it is a password storage function You have an elliptic curve private key that you want to encrypt using a user's password. Of course you don't want to use the passwor...
I was able to get it to work. A few issues got into the way. First, you have to allow IOS to accept self signed certificates. This requires to set up AlamoFire serverTrustPolicy: let serverTrustPolicies: [String: ServerTrustPolicy] = [ "your-domain.com": .disableEvaluation ] self.sessionManager = Al...
I Have modified your code, try this let ext = "jpg" let imageURL = NSBundle.mainBundle().URLForResource("imagename", withExtension: ext) print("imageURL:\(imageURL)") let uploadRequest = AWSS3TransferManagerUploadRequest() uploadRequest.body = imageURL uploadRequest.key = "\(NSProcessInfo.processInfo().globallyUniqu...
If you follow all steps of adding a custom field to user, you will finish the tasks successfully. Here is all steps to add a custom field to user: Create an ASP.NET Web Application Make sure you select MVC and the Authentication is Individual User Accounts Go to Models folder → Open IdentityModels.cs → ApplicationUs...
Below is a working solution. resource/alfresco/extension/new-user-email-context.xml: <?xml version='1.0' encoding='UTF-8'?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/...
If you want to use graph API to get User info. You need to add token to your request header like following: client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", TokenForUser); Here is the code snippet that could help to list User info, hope it could give you so...
After exhausting the current spectrum of available options from Javascript I decided to simply implement certificate pinning natively it all seems so simple now that I'm done. Skip to headers titled Android Solution and IOS Solution if you don't want to read through the process of reaching the solution. Android ...
Set CloseStream to false, otherwise the output stream will be closed when you call pCopy.Close(). pCopy = new PdfSmartCopy(doc, msOutput) { CloseStream = false }; Explanation I found no documentation over the Internet so I had to look at the source code directly. Here's the declaration of the PdfSmartCopy class: publ...
It's clearly saying that the validate() method is throwing an exception. If you want it to not to throw an exception, update your App\Exceptions\Handler class and add ValidationException to the $dontReport array: class Handler extends ExceptionHandler { /** * A list of the exception types that should not be...