 the user.
     *
     * Once the user will proceed to authorization (even in case of error) he will redirected to the provided URI, with some query parameters including the code in case of success, or an error if something went wrong
     *
     * <strong>Warning:</strong> The redirect URI has to be whitelisted in the account server!
     *
     * @param _redirect The redirect URI where the user should be driven after authorization
     * @return The HttpUrl where the user should go to access the authorization form
     */
    public HttpUrl buildAuthorizationURL(URI _redirect) {
        return new HttpUrl.Builder()
               .host(accountServer.getHost())
               .scheme(accountServer.getScheme())
               .port(accountServer.getPort() == -1? (accountServer.getScheme().equals("http")? 80 : 443) : accountServer.getPort())
               .addPathSegments("users/authorize")
               .addQueryParameter("client_id", clientId)
               .addQueryParameter("redirect_uri", _redirect.toString())
               .addQueryParameter("response_type", "code")
               .build();
    }

    /**
     * Request a token from an authorization-code after successfull authorization
     *
     * @param _authorizationCode the authorization-code generated by the account server
     * @return the AsyncRenewableJsonWebToken as an Observable stream
     */
    public Observable<AsyncRenewableJsonWebToken> getToken(String _authorizationCode) {
        return Observable
               .create((Subscriber<? super HttpUrl> t) -> {
                    try {
                        t.onNext(new HttpUrl.Builder()
                               .host(accountServer.getHost())
                               .scheme(accountServer.getScheme())
                               .port(accountServer.getPort() == -1? (accountServer.getScheme().equals("http")? 80 : 443) : accountServer.getPort())
                               .addPathSegments("users/token")
                               .build()
                        );
                        t.onCompleted();
                    } catch (Exception ex) {
                        t.onError(ex);
                    }
                })
               .flatMap(HttpRequest::from)
               .flatMap((HttpRequest t) -> HttpRequest
                       .buildRequestBody(new TokenRequest(_authorizationCode))
                       .map((RequestBody rb) -> {
                            t.getBuilder().post(rb);
                            return t;
                        })
                )
               .doOnNext((HttpRequest t) -> {
                    t.getBuilder().header("Authorization", getBasicAuthHeader());
                })
               .flatMap((HttpRequest t) -> t.doExecuteForType(TokenResponse.class))
               .map((TokenResponse t) -> new AsyncRenewableJsonWebToken(t.accessToken, System.currentTimeMillis() + 1000 * t.expiresIn, t.refreshToken, this));
    }

    /**
     * Request a refresh for the provided token.
     *
     * <strong>This in internally used and should not be used by users</strong>
     *
     * @param _token The Token to be refreshed
     * @return the AsyncRenewableJsonWebToken as an Observable stream. The returned one is actually the updated provided one
     */
    public Observable<AsyncRenewableJsonWebToken> refreshToken(AsyncRenewableJsonWebToken _token) {
        return Observable
               .create((Subscriber<? super HttpUrl> t) -> {
                    try {
                        t.onNext(new HttpUrl.Builder()
                               .host(accountServer.getHost())
                               .scheme(accountServer.getScheme())
                               .port(accountServer.getPort() == -1? (accountServer.getScheme().equals("http")? 80 : 443) : accountServer.getPort())
                               .addPathSegments("users/token")
                               .build()
                        );
                        t.onCompleted();
                    } catch (Exception ex) {
                        t.onError(ex);
                    }
                })
               .flatMap(HttpRequest::from)
               .flatMap((HttpRequest t) -> HttpRequest
                       .buildRequestBody(new RefreshRequest(_token.getRefreshToken()))
                       .map((RequestBody rb) -> {
                            t.getBuilder().post(rb);
                            return t;
                        })
                )
               .doOnNext((HttpRequest t) -> {
                    t.getBuilder().header("Authorization", getBasicAuthHeader());
                })
               .flatMap((HttpRequest t) -> t.doExecuteForType(TokenResponse.class))
               .map((TokenResponse t) -> _token.refresh(t.refreshToken, t.accessToken, System.currentTimeMillis() + 1000 * t.expiresIn));
    }

    private class TokenRequest {

        private final String clientId = AsyncAuthorizationCode.this.clientId;
        private final String grantType = "authorization_code";
        private final String code;

        private TokenRequest(String _code) {
            code = _code;
        }
    }

    private static class TokenResponse {

        private String tokenType;
        private String refreshToken;
        private String accessToken;
        private long expiresIn;

    }

    private class RefreshRequest {

        private final String clientId = AsyncAuthorizationCode.this.clientId;
        private final String grantType = "refresh_token";
        private final String refresh_token;

        private RefreshRequest(String _refresh_token) {
            refresh_token = _refresh_token;
        }
    }

}
A new global minimum tax on certain multinational companies will create the potential for double taxation on insurance companies, according to a new report from rating agency, AM Best.
This is given the accounting differences for global insurance companies in different jurisdictions and compared with other industries.
An Organization for Economic Cooperation and Development (OECD) proposal includes a new minimum tax rate of 15% that would apply to companies, including insurers, with revenue above 750 million euros.
That's right, Genius Desserts is almost here, and we couldn't be more thrilled! It's available for pre-order today, and you lucky ones who get there first will receive your limited-edition copy, lovingly signed by author and Food52 Creative Director Kristen Miglore, in September.
To make this book happen, Kristen has been scouting, testing, and tasting desserts (this was the hardest task) for the better part of two years—with an incredible amount of help from you. We're proud to share the more than 100 recipes, tips, and riffs she's unearthed along the way, which include the ones you've loved best over the years from the Genius Recipes column, and the brand new ones you've helped find.
In Genius Desserts, you'll get to know standout recipes that'll make your baking legendary—teaching you a new technique, showing you how to turn an ingredient on its head, or just guiding you to the very best dang version of your favorite sweet (including three types of chocolate cake—three!).
This means timeless classics like Maida Heatter’s East 62nd Street Lemon Cake, François Payard’s Flourless Chocolate-Walnut Cookies, and Nancy Silverton’s Butterscotch Budino. It also means little-known gems that will make you scratch your head and salivate simultaneously: a comforting Peach Cobbler with Hot Sugar Crust from Renee Erickson, an imaginative Parsnip Cake with Blood Orange Buttercream from Lucky Peach, a ridiculously simple and rewarding Ten-Minute Lime Cracker Pie from J. Kenji López-Alt.
We're also over the moon that we can finally show you the cover, which features one of our favorite recipes in the book: Anita Shepherd's chocolate birthday cake with super-fluffy frosting (and a few surprises). It's a fudgy, show-stopping crowdpleaser, but one you can whip up at a moment's notice without any fuss—entirely from ingredients you probably already have in your pantry. Pretty genius, right?
Ta-da! Genius Desserts, right at home!
Watch the cover come to life in this adorable video of Kristen and Anita making the cake, and try not to say "Aww!" too many times. Nothing like fluffy chocolate frosting to bring people together.
Pre-order your copy of Genius Desserts today, and get it in the mail in September! The first 500 copies will be exclusively signed by Kristen, so hop to it.
It is only a matter of time before a shortage of oxygen occurs unless Sri Lanka controls the number of Covid-19 cases, the Association of Medical Specialists (AMS) President Dr. Lakkumar Fernando says.
Dr. Fernando said yesterday that the public should be told the truth about the situation and statements that gave a false sense of security would only make matters worse.
