Skip to content

Instantly share code, notes, and snippets.

@tobecwb
tobecwb / DummyUserDetailsService.java
Created October 16, 2019 12:59
Kerberos Login with Spring Boot
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
public class DummyUserDetailsService implements UserDetailsService {
@Override
public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {

Mapillary Upload Photos

This document show how to upload images on Mapillary. Mapillary currently don't have any good documentation on how to upload the images, only some confuse Python code with a lot of things that nobody wants if was implementing on own code.

So, looking at the Python code, I have concluded that to upload a photo, or a photo sequence, you need the following information:


@tobecwb
tobecwb / auth.service.ts
Created October 18, 2017 19:57
Angular 4 Authentication with REST API and JWT Token
import { Injectable } from '@angular/core';
import * as jwt_decode from 'jwt-decode';
import {isUndefined} from 'util';
import {HttpClient, HttpErrorResponse, HttpHeaders, HttpResponseBase} from '@angular/common/http';
import 'rxjs/add/operator/map';
import 'rxjs/Rx';
export const TOKEN_NAME = 'jwt_token';
const AUTH_HEADER_KEY = 'Authorization';
const AUTH_PREFIX = 'Bearer';